Ask the Expert

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. >

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: