HighTechTalks DotNet Forums  

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

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss How to get the real object instead of a skeleton object, when calling a webservice in asp.net 2.0 in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
heinrich.elsigan
 
Posts: n/a

Default How to get the real object instead of a skeleton object, when calling a webservice in asp.net 2.0 - 05-02-2006 , 03:12 AM






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+skeleton+%22r eference.cs%22+object+method&rnum=1&hl=de#842ff707 10b55517)http://groups.google.at/group/microsoft.public.dotnet.framework.aspnet.webservic es/browse_thread/thread/4a3f1c973dc2829f/842ff70710b55517?lnk=st&q=webservice+skeleton+%22r eference.cs%22+object+method&rnum=1&hl=de#842ff707 10b55517
)

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.


Reply With Quote
  #2  
Old   
Peter Chana
 
Posts: n/a

Default Re: How to get the real object instead of a skeleton object, whencalling a webservice in asp.net 2.0 - 05-08-2006 , 03:29 PM






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


heinrich.elsigan wrote:

Quote:
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+skeleton+%22r eference.cs%22+object+method&rnum=1&hl=de#842ff707 10b55517)http://groups.google.at/group/microsoft.public.dotnet.framework.aspnet.webservic es/browse_thread/thread/4a3f1c973dc2829f/842ff70710b55517?lnk=st&q=webservice+skeleton+%22r eference.cs%22+object+method&rnum=1&hl=de#842ff707 10b55517
)

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.


Reply With Quote
  #3  
Old   
Willy Van den Driessche
 
Posts: n/a

Default Re: How to get the real object instead of a skeleton object, when calling a webservice in asp.net 2.0 - 05-21-2006 , 02:09 AM



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


"heinrich.elsigan" <heinrich.elsigan (AT) gmail (DOT) com> schreef in bericht
news:1146557557.714092.29640 (AT) g10g2000cwb (DOT) googlegroups.com...
Quote:
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+skeleton+%22r eference.cs%22+object+method&rnum=1&hl=de#842ff707 10b55517)http://groups.google.at/group/microsoft.public.dotnet.framework.aspnet.webservic es/browse_thread/thread/4a3f1c973dc2829f/842ff70710b55517?lnk=st&q=webservice+skeleton+%22r eference.cs%22+object+method&rnum=1&hl=de#842ff707 10b55517
)

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.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.