سؤال

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);

نصائح أخرى

httpTransport.call(SOAPACTION,soapEnvelope);

think in this line may be the issue, try using soapAction in call method instead.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top