TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
stallamy
NA
1
0
Deserializing complex objects
Jan 17 2005 10:56 AM
I'm trying to use C# to connect to a SOAP server but having problems receving complex objects as return values. Here is the code: First is my proxy: [System.Web.Services.WebServiceBindingAttribute(Name="urn:ItemManager",Namespace="urn:Configuration")] public class Configuration: SoapHttpClientProtocol { public Configuration() { this.Url = "http://localhost:7001/soap/servlet/rpcrouter"; } [SoapDocumentMethodAttribute ("",RequestNamespace="urn:Configuration",ResponseNamespace="urn:Configuration",Use= System.Web.Services.Description.SoapBindingUse.Encoded, ParameterStyle=SoapParameterStyle.Wrapped)] public SiteConfig getSiteConfig() { object [] results = this.Invoke("getSiteConfig", new object[] {}); SiteConfig site = (SiteConfig)results[0]; return site; } } My complex object: public class SiteConfig { public int numRouters; public int numSwitches; } Test client: public class Test { public static void Main(string[] args) { Configuration config = new Configuration(); SiteConfig site = config.getSiteConfig(); Console.WriteLine(site.numRouters+""); } } The problem I am getting is I get a "System.NullReferenceException: Object reference not set to an instance of an object." on the line Console.WriteLine(site.numRouters+""); in the Test client. I've been looking at the SOAP messages and they seem to be working find. The response from the server looks like:
10
20
Any help would be great!
Reply
Answers (
1
)
File or assembly name System.Web, or one of its dependencies, was not found.
Trouble creating webservice with custom object