Strange behaviour

O

Oscar Thornell

Hi,

I use the xsd.exe tool to generate C# classes from an Xml schema. We can
call the root object "MyObject" for simplicity...

I expose "MyObject" in a web service like this... public void
Upload(MyObject obj){..}

When I set a web reference from a client to my web service the generated
WSDL exposes the type "MyObject" as "obj" i.e. the variabel name I use in
the method signature is used by the framework to generate the type name that
clients will see and use. Pretty strange?

In my client I read an xml file from disc and use XmlSerializer to
deserialize the xml into an instance of "MyObject"...on the client it will
actualy be an instance of "obj"...

I then call my Service.Upload() and everything works as expected...I'll get
the instance on the server side and can work with the data...

If I manually edited the WSDL file and changes the type from "obj" to what
it should be "MyObject"...the everything works on the client side...but when
I hit the server side the instance is null...??

Could some smart person out there explain this?

Regards
/Oscar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top