Thanx but for some reasons I don't want to pass the parameters in the invoke
method. So far the way I do it is by building the SOAP body element. Maybe
in the future I will do it the way explained in the examples, right now I
just can't use that way.

So shouldn't the setType(Qname) method do what I want ?

Regards,
Jerome

-----Original Message-----
From: Reinhard Moser [mailto:[EMAIL PROTECTED] 
Sent: vendredi 25 juillet 2003 08:40
To: [EMAIL PROTECTED]
Subject: Re: Setting type of a SOAP body element - problem


Hi Jerome,

   i'm setting parameters to the SOAP call through calling the method 
call.addParameter() and set all parameters when calling call.invoke(  new
Object[]{parm1, parm2, ..} ).

   May have a look at the userguide examples which you can find at 
<axis-dir>/samples/userguide (e.g. Example2).

regards

Reinhard

Jerome Baumgarten wrote:

> Hi,
> 
> I'm trying to make a call to a Web Service and specify the type for 
> every parameter. To make the call I use the following code :
> 
>               Service service = new Service();
>               Call call = null;
>               try {
>                       call = (Call) service.createCall();
>               } catch (ServiceException SEx) {
>                       logger.warning(
>                               "Caught ServiceException while creating a
> new SOAP Call\n"
>                                       + SEx.getLocalizedMessage());
>                       return null;
>               }
>               call.setTargetEndpointAddress(sc.getEndpointURL());
> 
>               //make the SOAP body
>               SOAPBodyElement requestBody = new SOAPBodyElement();
>               requestBody.setName(sc.getMethodName());
>               requestBody.setNamespaceURI(sc.getNamespaceURI());
> 
>               //add children for parameters
>               try {
>                       for (int i = 0; i < params.length; i++) {
>                               SOAPBodyElement soapBEParam =
params[i].makeSOAPBodyElement();
>       
> soapBEParam.setType(org.apache.axis.Constants.XSD_STRING);
>                               try {
>                                       logger.finest("***** TESTING
> *****\n" + DOMSerializer.Serialize(soapBEParam.getAsDocument())); 
>                               } catch (Exception e) {
>                                       e.printStackTrace();
>                               }
>                               requestBody.addChildElement(soapBEParam);
>                       }
>               } catch (SOAPException SOAPEx) {
>                       logger.warning(
>                               "Caught a SOAPException while adding
> parameters to the SOAPBodyElement\n"
>                                       + SOAPEx.getLocalizedMessage());
>                       return null;
>               }
> 
> But it seems to me that the type is not set. Is it the right method ? 
> I also tried by adding an xsi:type attribute but with no luck.
> 
> Regards,
> Jerome

Reply via email to