Manish Pansiniya's Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

Change the method’s message name using WebMethodAttribute or change the type’s root element using the XmlRootAttribute."

with one comment

We have just received the error when we tried to return a type which contains Response behind it.

Like,

We have webmethod, UpdateStatus and we have following signature

Public Function UpdateStatus(….) as UpdateStatusResponse

But it gives us above exception when I try it using URL to access the service. Then after some debugging and googling, I found that, .NET uses internal class that uses UpdateStatusResponse. If I change the name to UpdateStatusResult and error gone Smile

Advertisements

Written by Manish

May 26, 2011 at 4:26 pm

One Response

Subscribe to comments with RSS.

  1. Wow… thanx. That would have taken A LOT of time to find. Strangly enough it worked if I called my method via AJAX, but not if I saw the webservice directly

    Brian

    June 1, 2011 at 1:24 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: