elsewhere home of a .NET geek

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 1 Stories | 52 Comments | 35 Trackbacks

News

This blog has random information about Managed Code and Design Pattern. Every day, while i code, the thoughts come in mind are the one you would be reading here.

If you're seeking me for asking any questions, please use the contact page of this site.

Twitter












Article Categories

Archives

Post Categories

When you are developing some webservices may be for Ajax implementation in your website this post would help you in any case. For instance, you want to have a method which is exposed as a WebMethod to the user. This method uses some class or initializes some other classes object you may find an error that tells you that you're missing something to include.

The possible solution is you have

[System.Xml.Serialization.XmlInclude(typeof(FooClass))]

to permit the WebMethod to allow to access the FooClass object. The reason is that the .NET stops this method to make calls to other classes/objects which are not permitted by the developer

One more tip: When you are using WebMethod to expose an method to webservice call, if you want to maintain the current session state, you should set the EnableSession as like this

[WebMethod(EnableSession=true)]

then, you can use the HttpContext.Current.Session to make use of the current session information

posted on Tuesday, May 02, 2006 5:10 PM