Hi Everyone,
I was wondering if someone could help me with this. I am sending requests and getting responses from a server using XML serialization. I have to make an XML request that looks like this.....
I need to populate this request with information to send to the server. Now, I already have the seialization and deserialization already programmed and working. My issue is that the
My c# code looks like.......
EntityRequest request =
new EntityRequest();request.entityRequest.entity.entityName = "My Name";
request.entityRequest.entity.address.streetLineOne = "My Street";
request.entityRequest.entity.address.city = "My City";
request.entityRequest.entity.address.state = "My State";
request.entityRequest.entity.address.postalCode = "12345";
//The above code works fine, but when I try to use the array..
request.entityRequest.entity.contactList.contacts[0].description = "FAX";
request.entityRequest.entity.contactList.contacts[0].telephone.number = "123-456-7890";
I get the error "Object reference not set to an instance of an object" pointed at the array.
Could anyone help me put this in a proper array? I will provide more code and explainations if needed. Thanks to everyone in advance.
Regards,
Jay
JayPosted Dec 3, 2008, 1:31 PM
I've figured it out. Thanks anyway everyone.
Jay