如何在以下代码中找到NAMESPACE,SOAPACTION和METHOD

时间:2019-05-15 10:19:22

标签: java android soap ksoap2

我使用了三星应用程序内购买功能。在此调用中,Android中的SOAP请求。

发布网址: https://iap.samsungapps.com/iap/ws/RTCService?wsdl

xmlns:ws="http://ws.iap.samsung.com/">

    <soapenv:Header/>

    <soapenv:Body>

        <ws:createServiceToken>

            <secret>213fdv23</secret>

        </ws:createServiceToken>

     </soapenv:Body>

</soapenv:Envelope>

我已经使用此代码调用了Web服务。

String URL = "https://iap.samsungapps.com/iap/ws/RTCService?wsdl";
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    request.addProperty("secret", "12435edsf");// Parameter for Method
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;// **If your Webservice in .net otherwise remove it**
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

    try {
        androidHttpTransport.call(SOAP_ACTION, envelope);// call the eb service
        // Method
    } catch (Exception e) {
        e.printStackTrace();
    }

    // Next task is to get Response and format that response
    SoapObject obj, obj1, obj2, obj3;
    try {
        obj = (SoapObject) envelope.getResponse();
    } catch (SoapFault soapFault) {
        soapFault.printStackTrace();
    }

Android出现此错误。 SoapFault-错误代码:'soap:Client'错误字符串:'读取XMLStreamReader时出错。 faultactor:“ null”详细信息:null

0 个答案:

没有答案