[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Pass object through Webservice

Posted on 2006-03-29
Medium Priority
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
  • 2

Accepted Solution

gabeso earned 1000 total points
ID: 16319255
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

ID: 16319277
I'm using .NET

Author Comment

ID: 16319286
I'm using .NET
May I use .NET Remoting, how to use it ??

Assisted Solution

rakshithks earned 1000 total points
ID: 16320156
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

873 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