Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie Soap question: returning multiple values  RSS feed

 
Rick Crawford
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all. I'm hoping someone here can give me some advice.
I've got an assignment that is going to involve sharing a Java application's functionality to a non-Java (VB) client. The Java application is hosted on a webserver running Tomcat. This client will have to access the application across our company's network. I'm thinking that creating a Soap service may be the way to go.
I downloaded the Soap SDK from Apache. I found a simple tutorial that demonstrated how to build an Soap-RPC service with a Java client. I modified the example to actually return data extracted from a database:
First the server:

Next, the client:

It seems to work okay. But I'm not sure where to go from here. My actual implementation will be MUCH more complicated than this. For my use, this server would need to return back a lot of information about a customer than just its name. I need the server to pass back several attributes.. that could be placed in an XML datagram! Would I have to set up a separate 'getter' method for each attribute, and
re-run the service for each?
I really don't know how to even ask this, but I'll try: if your server needs to return more than one value, what are your options? I would
imagine that if I was going Java-to-Java, I might be able to pass back a JavaBean (or some other type of Java container, like a HashMap.) But what do you do if your client is non-Java?
I'm quite confused, and very much appreciate any advice on this!
Rick Crawford <><
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, first of all ditch Apache SOAP. Go get Apache Axis.
Build a web service that returns a Java bean with Apache Axis. Then run the Java2WSDL tool on your Java to produce WSDL -- then you can suck in this WSDL in Visual Studio .NET to build the VB client.
That's enormously simplified, but it's the basic way of achieving this.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!