style: rpc to document
Hi,
I've realised a web service with style=rpc and now I want to change to "document".
Everything is ok, but my DIIclient throw this error :ERROR org.jboss.ws.jaxrpc.CallImpl - Call invocation failed with SOAPFaultException
javax.xml.rpc.soap.SOAPFaultException: Endpoint cannot handle requests in state: CREATED
May be it's due to the type of the data sent and returned. any idea ?
here is my DIIclient code:Call call = service.createCall();
call.setOperationName(new QName(TARGET_NAMESPACE,"sendObject"));
call.addParameter("String_1", Constants.TYPE_LITERAL_STRING, ParameterMode.IN);
call.setReturnType(Constants.TYPE_LITERAL_STRING);
call.setTargetEndpointAddress(ENDPOINT);
Object[] params ={"hello"};
try{
String result= (String)call.invoke(params);
System.out.println(result);
}
catch (Exception e){
fail("Bad response format: "+ e);
}
If i change a line to "call.setReturnType(new QName(TARGET_NAMESPACE,"sendObjectResponse"));" it throws this error :
IllegalArgumentException: Invalid null parameter;
What do I have to do ?
FYI here is my WSDL:<definitions name='IWSCcmd' targetNamespace='http://com.emailvision.ws/ccmd/docstyle'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:ns1='http://com.emailvision.ws/ccmd/docstyle/types'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://com.emailvision.ws/ccmd/docstyle'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<schema targetNamespace='http://com.emailvision.ws/ccmd/docstyle/types'
xmlns='http://www.w3.org/2001/XMLSchema'
xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:tns='http://com.emailvision.ws/ccmd/docstyle/types'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<complexType name='sendObject'>
<sequence>
<element name='String_1' nillable='true' type='string'/>
</sequence>
</complexType>
<complexType name='sendObjectResponse'>
<sequence>
<element name='result' nillable='true' type='string'/>
</sequence>
</complexType>
<element name='sendObject' type='tns:sendObject'/>
<element name='sendObjectResponse' type='tns:sendObjectResponse'/>
</schema>
</types>
<message name='IWSCcmd_sendObject'>
<part element='ns1:sendObject' name='parameters'/>
</message>
<message name='IWSCcmd_sendObjectResponse'>
<part element='ns1:sendObjectResponse' name='result'/>
</message>
<portType name='IWSCcmd'>
<operation name='sendObject'>
<input message='tns:IWSCcmd_sendObject'/>
<output message='tns:IWSCcmd_sendObjectResponse'/>
</operation>
</portType>
<binding name='IWSCcmdBinding' type='tns:IWSCcmd'>
<soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='sendObject'>
<soap:operation soapAction=''/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
</operation>
</binding>
<service name='IWSCcmd'>
<port binding='tns:IWSCcmdBinding' name='IWSCcmdPort'>
<soap:address location='REPLACE_WITH_ACTUAL_URL'/>
</port>
</service>
</definitions>

