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

Discussion in 'ASP .Net Web Services' started by heinrich.elsigan, May 2, 2006.

  1. 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.
     
    heinrich.elsigan, May 2, 2006
    #1
    1. Advertising

  2. heinrich.elsigan

    Peter Chana Guest

    Re: How to get the real object instead of a skeleton object, whencalling a webservice in asp.net 2.0

    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:

    > 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.
    >
     
    Peter Chana, May 8, 2006
    #2
    1. Advertising

  3. 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" <> schreef in bericht
    news:...
    > 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.
    >
     
    Willy Van den Driessche, May 21, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    962
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    585
    batista
    Jan 26, 2006
  3. Peter Nordström

    Webservice calling a webservice.....Error

    Peter Nordström, Oct 21, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    189
    Peter Nordström
    Oct 21, 2003
  4. Calling a webservice from a webservice

    , Apr 19, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    171
  5. batista
    Replies:
    0
    Views:
    272
    batista
    Jan 26, 2006
Loading...

Share This Page