0

我是由一个带有soapaction =“”的wsdl的soap webservice提供的

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

像这样点击网络服务:

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;

但它的抛出异常:

org.xmlpull.v1.XmlPullParserException: Expected a quoted string (position:DOCDECL @1:62 in java.io.InputStreamReader@410b9d60) 
4

2 回答 2

1

您应该传递soapAction null(它将被ksoap2设置为空字符串)或传递带引号的空字符串: httpTransport.call("\"\"", soapEnvelope);

于 2013-08-19T17:04:57.320 回答
0

httpTransport.call(SOAPACTION,soapEnvelope);

认为这行可能是问题所在,请尝试在 call 方法中使用soapAction。

于 2013-08-14T09:58:11.957 回答