Q

How to send a complex type of object from a Java server to a VB Client?

I want to send a complex type of object from a Java server to a VB Client using SOAP service. Let's consider a simple example: In the front end, i.e. VB, I have a form where I need to display all the User Details (fname,lname,userId,Password,city,state) which will be in the database but I need to access this from the Java SOAP service only, because my server program was in Java.

I need one simple application where the Java server program will send the array of objects (user details as mentioned above) to the Client program which is in VB. I did an example that works fine with single parameters, returning SOAP service from Java to VB, but not the object kind of thing!

Please provide me sample codes for both server program and client program too...I am using Microsoft SOAP toolkit in VB and Apache SOAP in server side. >
The SOAPbuilders effort has managed to solve most interoperability problems when using simple types, but complex types are a different matter entirely. The Apache SOAP/Axis and .NET/MS Toolkit complex object containers are incompatible, so you have to do a bunch of stuff by hand. This email from the Apache SOAP archives provides some useful hints on what you need to do.

First, make sure you're using the latest versions of Apache SOAP (2.3.1) and MS SOAP Toolkit (3.0).

You can pass a simple structure of primitive types pretty easily. You need to define a user-defined type for your userDetail structure and then define a VB class for that type (kind of like a VB bean). Then you define a WSML file that tells MS SOAP how to map your user-defined type to your VB class. If you want to pass a more complex structure containing nested beans, you have to use the MS SOAP low-level API. See this tutorial for an example of using the low-level API. You'll need to create the ISoapTypeMapper_read and ISoapTypeMapper_write classes, which manage the process of reading and writing nested structures from the SOAP envelope using the DOM parsing functionality and the low level API.

Some of the other Java SOAP implementations have designed their complex object containers to be compatible with .NET, including Systinet WASP, The Mind Electric GLUE, IONA XMLbus, and BEA WebLogic Workshop. If you're willing to use one of these products, you can just use the auto-generated structures and it should work.

I recommend that you take a look at the WASP documentation on .NET integration. It includes a set of XML Schemas for Java collections that will interoperate with .NET.

This was first published in July 2002

Dig deeper on Simple Object Access Protocol (SOAP)

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close