Pass object through Webservice

Posted on 2006-03-29
Last Modified: 2010-04-17
I have a webserivce at server with a method (A method)  to return an object (B object with properties, methods)
At client, I use this webservice (A method) to return B object. Then I will use B object at client asif an normal object (I don't have B's class at client)

May I do that ??
Question by:truwe
    LVL 9

    Accepted Solution

    You will have to have class information at the client: Only data is passed to/from the webservice.

    If, for example, xml is being sent to the webservice (and returned) then you could instantiate a client side object from the returned xml data.

    Is this a java based system? .Net? What technology are you using?

    Author Comment

    I'm using .NET

    Author Comment

    I'm using .NET
    May I use .NET Remoting, how to use it ??
    LVL 1

    Assisted Solution

    yes  you can access the object if the class is defined as public. here is the solution.

    i assume this the methode in the webservice is

    public Class1 HelloWorld()
          return new Class1();
    and you define a "public" class in the webservice.

    at the reference of this web service.
    at the top the form type this using WindowsApplication3.localhost;
    (windowsapplication is application name and localhost is the webservice name)
    use this statement to create an object of type which defined in webservice.

    localhost.Class1 obj = new localhost.Class1();
    Service1 o =new Service1();
    obj = o.HelloWorld(); // calling the webservice method with returns the obj of type Class1


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    lucky13 challenge 11 96
    fizzArray  challenge 1 29
    scoreUp challenge 14 40
    python question 5 41
    This article will show, step by step, how to integrate R code into a R Sweave document
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now