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

x
?
Solved

Pass object through Webservice

Posted on 2006-03-29
6
Medium Priority
?
314 Views
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 ??
0
Comment
Question by:truwe
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
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?
0
 

Author Comment

by:truwe
ID: 16319277
I'm using .NET
0
 

Author Comment

by:truwe
ID: 16319286
I'm using .NET
May I use .NET Remoting, how to use it ??
0
 
LVL 1

Assisted Solution

by:rakshithks
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

[WebMethod]
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


0

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…
Progress

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