Maneesha,

Writing a generic/dynamic client is not a simple matter.
I assume that you plan on writing an application that loads
the WSDL definitions and from that automatically builds
the correct request message format.

If you don't like writing the Java Bean classes needed
for the input or output parameters, then perhaps a tool
to generate them automatically for you is the answer.
CapeStudio includes such a tool - the WSDL Assistant.

If you really do want something completly generic, one of the
problems you will have is how to initialise the values of
the input parameters in order to invoke the web service.
If you have such values in an XML file, then the problem becomes
one of converting that file into a format required to invoke
the web service. XSLT is a good way to achieve this.

The CapeStudio XSLT Mapper will help you with this. In fact it
is an example of a program which does what you are trying to.
If you have your input values in an XML file, you can load some 
WSDL from xmethods, map the values from your file onto a tree 
representation of the web service request message. Then you can 
simply click on a button to invoke the web service and view the
results. Even if you have no interest in writing XSLT, you might
find this useful for experimenting with the services on xmethods.

You can get CapeStudio at: http://www.capeclear.com/products/capestudio/

And yes, if the server is using SOAP encoding (as opposed to literal),
the client must also. This is the same for "document" verses "rpc" style.
The combination of these settings leaves you with four possibilities
for how the request message can be formatted. 

James.

Cape Clear Software Limited.
61 Fitzwilliam Lane
Dublin 2
Ireland

Email : [EMAIL PROTECTED]
Switchboard  : + 353 (1) 2419900
Direct line  : + 353 (1) 2419957
Fax          : + 353 (1) 2419901
www          : www.capeclear.com


-----Original Message-----
From: Maneesha Jain [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 5:40 PM
To: [EMAIL PROTECTED]
Subject: Generic SOAP client to webservices


Hi,

Question 1:
-----------
I'm trying to write a dynamic Apache SOAP Client that can
call any relatively simple
web service, say on www.xmethods.com. Some of these services
use complex types or nested
beans as input/output parameters.

On the client side, it seems, I would need to create a Java
Bean class for each of
these complex types and register it with
SOAPMappingRegistry. Since my SOAP client is intended to be
a generic client to any web service, is there a way that I
can call these services without creating Java Bean classes
needed for Input or Output parameters.


Question 2:
-----------

If the server side uses SOAP Encoding for Input/Output
parameters, do I need to use
the same encoding on the client side ?

Regards
Maneesha

Reply via email to