0

我正在努力SOAP Request为以下肥皂请求创建一个:

    <?xml version="1.0"?>
        <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Header/><SOAP-ENV:Body><ns1:Authenticate xmlns:ns1="urn:Login" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <msgstr xsi:type="xsd:string"><Message messageid="0">
              <Entity name="REF_LOGIN">
                <Property name="login_cd" value="ABC" type="STRING"/>
                <Property name="password" value="ABC" type="STRING"/>
                <Property name="machine_name" value="iPhone Simulator" type="STRING"/>
                <Property name="language_code" value="en" type="STRING"/&gt;
                <Property name="client_version_cd" value="XL7.11" type="STRING"/>
              </Entity>
            </Message></msgstr></ns1:Authenticate></SOAP-ENV:Body></SOAP-ENV:Envelope>
4

1 回答 1

0

希望这有帮助:我在这里发布了我的代码片段:适当地替换你的值

        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        PropertyInfo propInfo1 = new PropertyInfo();
        propInfo1.setName("Input_if_any");
        propInfo1.setValue(1);
        propInfo1.setType(int.class);
        request.addProperty(propInfo1);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
        envelope.dotNet = true; // put this only if the web service is .NET one
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        try {
            androidHttpTransport.call(SOAP_ACTION, envelope);
            // SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
            Object response1 = envelope.getResponse();
            SoapObject response = (SoapObject) response1;

            Log.i("myApp", response1.toString());
            if (response1.toString().equalsIgnoreCase("true")) {
                result = true;
            }
于 2013-07-11T06:32:06.150 回答