Hi,

I'm trying to invoke an external soap service operation which takes
integers as the parameters.

*Request Body of the Soap Service *:

*<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>"
xmlns:add="http://wso2.org/wso2con/2011/sample/adder
<http://wso2.org/wso2con/2011/sample/adder>">*
*   <soapenv:Header/>*
*   <soapenv:Body>*
*      <add:AdderProcessRequest>*
*         <add:a>?</add:a>*
*         <add:b>?</add:b>*
*      </add:AdderProcessRequest>*
*   </soapenv:Body>*
*</soapenv:Envelope>*

I have created a client to invoke the soap operation using
JaxWsDynamicClientFactory.
JaxWsDynamicClientFactory clientFactory =
JaxWsDynamicClientFactory.newInstance();

I have invoked the operation by passing the operation name and the
parameters to the client.
When multiple parameters of type *string* is passed, no error is given.

In this request I need to pass 2 *integers* as the parameters as shown
below :
client.invoke("operationName", num1, num2);
But when I do so I get the following error :

*java.lang.IllegalArgumentException: Part
{http://wso2.org/wso2con/2011/sample/adder}payload
<http://wso2.org/wso2con/2011/sample/adder}payload> should be of type
org.wso2.wso2con._2011.sample.adder.AdderProcessRequest, not
java.lang.Integer*
* at
org.apache.cxf.jaxb.io.DataWriterImpl.checkPart(DataWriterImpl.java:284)*
* at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:212)*
* at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:122)*
* at
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)*
* at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)*
* at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)*
* at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)*
* at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)*
* at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)*
* at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)*
* at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)*

 Appreciate any help on this.

Best Regards,
*Natasha Wijesekare*

*Software Engineering Intern, WSO2  Inc:  http://wso2.com
<http://wso2.com/>*
*email  : nata...@wso2.com <nata...@wso2.com>*
*mobile: +94 771358651*
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to