I have been provided by a soap webservice which has a wsdl with soapaction = ""
<wsdl:binding name="SimpleSearchRequestSoapBinding" type="impl:SimpleSearchRequest">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getSearchResults"><wsdlsoap:operation **soapAction=""**/>
<wsdl:input name="getSearchResultsRequest">
<wsdlsoap:body use="literal"/></wsdl:input>
<wsdl:output name="getSearchResultsResponse">
<wsdlsoap:body use="literal"/></wsdl:output>
</wsdl:operation>
Hitting the webservice like this:
SoapObject request = new SoapObject(OKMConstants.NAMESPACE, OKMConstants.OPERATION_NAME);
request.addProperty("searchParam","faq");
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
soapEnvelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(OKMConstants.url);
httpTransport.call("", soapEnvelope);
// Object response = soapEnvelope.getResponse();
SoapObject result = (SoapObject)soapEnvelope.bodyIn;
But its throwing exception:
org.xmlpull.v1.XmlPullParserException: Expected a quoted string (position:DOCDECL @1:62 in java.io.InputStreamReader@410b9d60)
You should pass soapAction null
(it will be set as empty string by ksoap2) or pass empty string with quotes:
httpTransport.call("\"\"", soapEnvelope);