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/microsoft.public.dotnet.framework.aspnet.webservic
es/browse_thread/thread/4a3f1c973dc2829f/842ff70710b55517?lnk=st&q=webservice+sk
eleton+%22reference.cs%22+object+method&rnum=1&hl=de#842ff70710b55517)http://gro
ups.google.at/group/microsoft.public.dotnet.framework.aspnet.webservices/browse_
thread/thread/4a3f1c973dc2829f/842ff70710b55517?lnk=st&q=webservice+skeleton+%22
reference.cs%22+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.
Peter Chana - 08 May 2006 21:29 GMT
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
> Hello everybody!
>
[quoted text clipped - 16 lines]
> Best regards
> Heinrich.
Willy Van den Driessche - 21 May 2006 08:09 GMT
This is by design.
However, in ASP.NET 2.0 you are able to create a SchemaImporterExtension.
These are not simple to write but they do allow you to generate the code you
want.
http://msdn2.microsoft.com/en-US/library/w46ccb0h.aspx
> Hello everybody!
>
[quoted text clipped - 16 lines]
> Best regards
> Heinrich.