How to get the real object instead of a skeleton object, when calling a webservice in asp.net 2.0

  • Thread starter heinrich.elsigan
  • Start date
H

heinrich.elsigan

Hello everybody!

To get the real object with all it's methods in asp.net 1.1,
I just had to modify the reference.cs file of my webservice
client project. (I want to override the ToString()
method of the real object)
(Regarding to:
http://groups.google.at/group/micro..."+object+method&rnum=1&hl=de#842ff70710b55517
)

In Asp .Net 2.0 this solution doesn't seem to work because
there is no refernce.cs file created anymore. There is only
the mapinfo file which describes the skeleton objects,
the C# Versions of this definitions become generated on the fly.
There is no obvious way for me to change to real objects.

Has anybody got an idea, how to solve this problem?

Best regards
Heinrich.
 
P

Peter Chana

Hello Heinrich,

I had exactly the same problem. Finally, here's my solution.

Follow these steps in correct order:

1) You are right, there's is no 'referece.cs' proxy class anymore but you
still can generate it with the wsdl.exe tool from the .Net 2.0 Framwork.
That also means, that you first have to remove the web references in your
WebClient project. Afterwards generate the proxy class with this command

=> wsdl.exe /out:myProxyClass.cs
=> http://hostServer/WebserviceRoot/WebServiceName.asmx?WSDL

2) This step is the important one. The newly generated proxy class must be
modified to use the real objects. Open the class in Code View and remove the
skeleton class definitions from the file. Finally add the namespace of your
real entity classes.

3) If you have done everything right, your code will compile and the methods of
your WebService will return the real objects instead of the skeletons.

Have fun ;-)

Peter
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top