androidsoapandroid-ksoap2

How to Call Empty "soapAction"?


I am working in WSDL and i use Ksoap2 for my android project. But i had a problem. We know, we call any operation with soapAciton URL. This url made, NAMESPACE + METHOD_NAME. My web services had many operations but they soapActions are empty.

WSDL Source:

<wsdl:operation name="PLTR1">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="PLTR1">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="PLTR1Response">
<soap:body use="literal"/>
</wsdl:output></wsdl:operation>

So, i give this values in my android project;

   private static final String METHOD_NAME = "PLITR1";
   private static final String NAMESPACE = "http://****.com/";
   private static final String SOAP_ACTION = "";
   private static final String URL = "http://**.**.**.**/***/*****?WSDL";

I set my values for operation and envelope them. When i envelope package; envelope bodyOut save my values. But, when i set with SoapPrimitive, i take null values. I think, it will be my SOAP_ACTION is empty.

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        try {
            androidHttpTransport.debug=true;
            androidHttpTransport.call(SOAP_ACTION,envelope);
            SoapPrimitive result =  (SoapPrimitive) envelope.getResponse();
            textView.setText(result.toString());

        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        }

How we can solve this problem?


Solution

  • I've solved the problem with the following code:

    envelope.dotNet = false;
    envelope.setAddAdornments(false);