RE: WSIF and complex types

"Luca Baldi" <[email protected]> Mon, 10 Oct 2005 09:45:49 +0100
Newsgroups gmane.comp.apache.webservices.wsif.user
Message-ID <ABC231AADE3CE44495F858C2A7782519152C26@MANEXCHANGE.i-documentsystems.com>
Here's some code snippets

 

**** create a javax.wsdl.Operation for the selected operation

Operation operation = (Operation) getOperations().get(operationName);

.

.

.

**** get an Iterator to run through the INPUT or OUTPUT messages

Iterator it = null;

        if (INPUT.equalsIgnoreCase(mappingType)) {

            it =
operation.getInput().getMessage().getParts().values().iterator();

        } else if (OUTPUT.equalsIgnoreCase(mappingType)) {

            it =
operation.getOutput().getMessage().getParts().values().iterator();

        }

 

Hope this helps

 

Luca

 

________________________________

From: [email protected] [mailto:[email protected]]

Sent: 10 October 2005 09:38
To: [email protected]
Subject: WSIF and complex types

 

Hi Luca,

You said that you build your input according to the WSDL
descriptor...but how you do this?

In XML with DOM api (or SAX) ?

I'm just trying the strikeiron SDK (trial version) which is very easy to
use! If someone used it and had some opinions to share...

Thanks a lot for you answer...

Delphine.

----- Original Message ----- 

From: Luca Baldi <mailto:[email protected]> 

To: [email protected] 

Sent: Wednesday, October 05, 2005 9:11 PM 

Subject: RE: WSIF and complex type 

Hi. I tried to use WSIF with complex types a few weeks ago, and decided
that if you want to consume web services dynamically with complex types
you?re better off starting from scratch. What I mean is that you can use
Apache Axis ( or SOAP ) library to create your SOAPMessage and populate
it with whatever you want. 

The steps that I take are the following; 

*	Read in the WSDL descriptor 
*	Get the SOAP binding and list all the operations associated with
the appropriate PortType 
*	Pick an operation 
*	Build input according to the WSDL descriptor 
*	Create the request SOAPMessage and invoke the web service 
*	Process the response SOAPMessage that comes back ( if you?re
lucky, with no errors !! :-) ). What to expect is again based on the
WSDL file 

 

It?s quite a complex process if you want to be able to handle any web
service. I reckon the best approach would be to create the Body of the
SOAPMessage as xml, and just add it to the SOAPBodyElement. Having said
that, I haven?t done that for a variety of reasons ( which I am
regretting a wee bit now ). 

Basically if you follow your solution 1, you should be able to tackle
this.