Follow me on Twitter at Twitter.com/wbm
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
Setting up a Web Service with the new Atlas Bits - Microsoft AJAX Library and ASP.NET 2.0 Ajax Extensions - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on .NET, Sql, ASP.NET, and other crazy shenanigans

News

Personal Blog

Work Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

Setting up a Web Service with the new Atlas Bits - Microsoft AJAX Library and ASP.NET 2.0 Ajax Extensions

To call a web service through the Microsoft AJAX Library, you will need to add the Microsoft.Web.Script.Services namespace to the using/import statements for your web service, unless you would like to add the complete name to the attributes.  This is a change from the previous CTPs.  I had liked that there was no code changes that needed to be done for the web services in the previous CTPs.  Now, I have to add some attributes to my web service class.

If you are going to call your web services, you will need to add two new attributes to your web service classes.  These are:

    [ScriptService] // This attribute must be on your web services anyway. 

    [GenerateScriptType(typeof(ComplexDataType))] // needed if you are going to pass a complex data type

Where ComplexDataType is the type of data that you will transfer.  Using the Atlas Example from their site, the example would be

    [GenerateScriptType(typeof(Animal))]

If you don’t add the script service attribute, you might get an error like this:


Pulled from:

http://morewally.com/cs/blogs/wallym/archive/2006/10/20/426.aspx

http://morewally.com/cs/blogs/wallym/archive/2006/10/20/428.aspx

Posted: Oct 21 2006, 08:43 AM by Wallym | with 1 comment(s)
Filed under: ,

Comments

Steve said:

Is it just horrible fixed-width-no-matter-what blog software that makes the text get cut off on the right side? 3 sentences are cut off while you are explaining what they are doing/telling the framework
# October 23, 2006 1:07 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)