Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
heinrich.elsigan - 02 May 2006 09:12 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.