I'm getting the below exception while accessing a restful web service
[SOAPException: faultCode=SOAP-ENV:Client; msg=No Serializer found to serialize a 'org.apache.soap.rpc.Parameter' using encoding style '
http://schemas.xmlsoap.org/soap/envelope/'.; targetException=java.lang.IllegalArgumentException: No Serializer found to serialize a 'org.apache.soap.rpc.Parameter' using encoding style 'http://schemas.xmlsoap.org/soap/envelope/'.]
This is the public URL of wsdl and client program
http://68.87.86.50/oss/services/ScoutPACKETCABLEResetService?wsdl ------------------------------------------------------------------------------
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.transport.http.*;
public class WSClient {
public static void main (String[] args) {
String strInput = "<?xml version=\"1.0\" ?><request><query app_key=\"GS_TEST\">";
strInput+="<device-list><device device_type=\"mac\">00:0e:5c:e7:a0:08</device>";
strInput+="</device-list></query></request>";
try {
URL url = new URL ("http://68.87.86.50/oss/rest/ScoutPACKETCABLEResetService");
Call call = new Call();
call.setTargetObjectURI("urn:resetPACKETCABLEDevice");
call.setMethodName("resetPACKETCABLEDevice");
call.setEncodingStyleURI(org.apache.soap.Constants.NS_URI_SOAP_ENV);
Vector params = new Vector ( );
params.addElement(new Parameter("parameter", String.class, strInput, null));
call.setParams (params);
call.setSOAPTransport(new SOAPHTTPConnection()) ;
Response resp = call.invoke(url, "");
if (resp.generatedFault( )) {
Fault fault = resp.getFault ( );
System.out.println ("\nOuch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ( ));
System.out.println (" Fault String = " + fault.getFaultString());
} else {
Parameter result = resp.getReturnValue ( );
System.out.print(result.getValue ( ));
}
}catch(Exception e) {
System.out.println(e);
}
}
}