Title: Message
Our application is working in two different steps.
 
The first step is where the end-user is specifying which web service he wants to call. In this step, we retrieve the WSDL and we analyze it (mainly an analysis of the complex type definitions). This analysis allows us to build, according to the data the user will provide, multiple XML documents which are compliant with each complex argument XSD type definition (the WSDL is defining complex types using XSD - the fun part is the differences between RPC and document encoding ....). This is where the real dynamicity is.
 
The second step is two use those XML documents (representing the arguments of the web service operation to call) and to build the SOAP message from it. Actually those XML documents are very close to what you will find in the SOAP message, so that part is not the difficult one. The hard part is the first step. The code of this second step look something like that:
 
import org.apache.axis.client.Call;
import
org.apache.axis.client.Service
;
import
org.apache.axis.message.SOAPBodyElement
;

import org.w3c.dom.Element;
....

    public void invoke(Element operationCallElement)
        throws MalformedURLException,
               RemoteException,
              
ServiceException
    {
       
Service service = new Service
();
       
Call call = (Call)service.createCall
();
       
SOAPBodyElement[] input = new SOAPBodyElement[] { new SOAPBodyElement
(operationCallElement) };
        call.
setTargetEndpointAddress
(new URL(serviceUrl));
        Object response = call.
invoke(input);
        traceResponse(response);
    }

As I said, the hard part is to create the operationCallElement (step1 of the process). It involves a deep understanding of the WSDL.
 
Thomas 
 
 
-----Original Message-----
From: Gold, Laurence (MLIM) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 10:00 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Dynamic Clients and Out Parameters/Complex types.

I would like to see what you got so far - the only hint I was given was by someone from IBM about using the org.apache.axis.wsdl.toJava.Emitter, but being unfamiliar with it I was not able to get it working.

 

LrAu

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent:
Tuesday, May 14, 2002 9:47 AM
To: [EMAIL PROTECTED]
Subject: RE: Dynamic Clients and Out Parameters/Complex types.

 

The only way we found so far is by using some low level interface in Axis to build the SOAP message by hand. No very pretty especially since it relies a lot of a deep analysis of the WSDL file.

 

If you get any good suggestions, I am interested. I saw a couple of things in the Web Services Invocation Framework (WSIF) that IBM is trying to donate to Apache/Axis, but it does not support complex type yet.

 

Thomas

 

 

-----Original Message-----
From: Gold, Laurence (MLIM) [mailto:[EMAIL PROTECTED]]
Sent:
Tuesday, May 14, 2002 9:01 AM
To: '[EMAIL PROTECTED]'
Subject: Dynamic Clients and Out Parameters/Complex types.

I have been poking around for a while using multiple java clients.  I have noticed that you can do a Dynamic Invoking of a Service (with or without WSDL) using the Service factory, but all the examples are returning a single value.  What if you had a complex value, or multiple out parameters?  Is there any way to dynamically invoke the service without having to build a "stub" or proxy class using wsdl2java?

 

Thanks for the help

Larry

 

Reply via email to