我如何使用Soap android studio提出很好的要求

问题描述 投票:1回答:1

我正在尝试在Java android studio应用程序上使用我的Web服务。

这是错误:org.ksoap2.transport http响应异常请求失败的代码400。

有我的代码:

public String call(){
        String a = username.getText().toString();

        String b = passeword.getText().toString();


        SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE, OPERATION_NAME);
        PropertyInfo pi = new PropertyInfo();
        pi.setName("email");
        pi.setValue(a);
        pi.setType(String.class);
        request.addProperty(pi);
        pi = new PropertyInfo();
        pi.setName("pass");
        pi.setValue(b);
        pi.setType(String.class);
        request.addProperty(pi);

        SoapSerializationEnvelope envel = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envel.dotNet = true;
        envel.setOutputSoapObject(request);

        HttpTransportSE httpTransportSE = new HttpTransportSE(SOAP_ADDRESS);

        Object resp = null;
        try{
            httpTransportSE.call(SOAP_ACTION, envel);
            resp = envel.getResponse();
        }
        catch (Exception e){
            resp = e.toString();
        }


        return resp.toString();


    }

谢谢

java android request http-status-code-400
1个回答
0
投票

你能不能给我一个注定!

© www.soinside.com 2019 - 2024. All rights reserved.