Serialization / Deserialization across WebService Calls

Discussion in 'ASP .Net Web Services' started by Robert Millman, Feb 5, 2004.

  1. A have a few questions related to how parameters and return types are serialized/deserialized across WebService calls. Here is my scenario

    A web method takes two strings as parameters and returns an instance of a custom object of type "WebService.MyClass". The proxy object that is generated in VS.Net contains the signature of the Web Method call, and also contains a "shell" definition for my custom class. However, the name space for this shell is now "ClientApp.Alias.MyClass"

    A couple of questions

    1) In my client code, I make the web method call and receive the returned value. However, I do not have the full class definition and cannot access methods, etc. on it, as the proxy object only contains a shell outlining the public variables. How do I cast the returned object from type "ClientApp.Alias.MyClass" to WebService.MyClass? Also realize that the "ClientApp.Alias" namespace will vary from project to project, depending on naming conventions, etc
    2) How do get private members of my custom class to participate in the serialization so that I receive a full functioning instance of my class

    Thank

    Robert Millman
    Robert Millman, Feb 5, 2004
    #1
    1. Advertising

  2. Robert Millman

    MSFT Guest

    Hi Robert,

    Thank you for using the community. As I understand, you want to convert the
    class "WebService.MyClass" from a web service to local class
    "ClientApp.Alias.MyClass", so that you can call its methods.

    In fact, If there is no real defination in the proxy for
    "ClientApp.Alias.MyClass", we can't call its method directly. As a work
    around, we can create Library project assembly for the "MyClass" and
    reference it in both of web service and client project. This require we put
    the assembly ob both of server and client.

    Another way is convert "MyClass" to a web service and its method to web
    methods. In this way, the methods will be executed on server.

    Does this answer your question?

    Luke
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    MSFT, Feb 6, 2004
    #2
    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. Replies:
    3
    Views:
    627
    Sahil Malik
    May 14, 2004
  2. =?Utf-8?B?TWlrZSBMb2dhbg==?=

    NameValueCollection Serialization Deserialization

    =?Utf-8?B?TWlrZSBMb2dhbg==?=, Dec 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,951
    Karl Seguin
    Dec 23, 2004
  3. Nimmi Srivastav
    Replies:
    12
    Views:
    13,419
    EventHelix.com
    May 29, 2004
  4. andrewzzz
    Replies:
    0
    Views:
    370
    andrewzzz
    Dec 12, 2008
  5. andrewzzz
    Replies:
    0
    Views:
    313
    andrewzzz
    Dec 16, 2008
Loading...

Share This Page