"Pritchie" <info-2007_RemoveThis_@thebigbunker.com> wrote in message
> Hi All, please help..
> Ok I've given up. Lets hope someone can help me out.
> I'm trying to write a web service using dot NET and C#.
> I've used xsd.exe to create my dataset from a .xsd file. I've then
> created a web-service method which passed this dataset as a parameter.
> However when I try to access this dataset as an object I get
> System.NullReferenceException: Object reference not set to an instance of
> an object.
NullReferenceException usually means what it says: you tried to dereference
a data item containing null. So the questions are: which data item are you
trying to dereference, and why is it null?
In the case of web services, the answers are frequently "I'm trying to
dereference an input parameter to my web method", and "because there's a
mismatch between the XML namespace that the server is expecting the elements
to be in, and the XML namespace being sent by the client". If your server is
expecting to receive something in namespace http://example.org, and you send
it something in http://example.org/myExample, then the web service will
receive null, because you didn't actually send it anything.
John Saunders [MVP]