SOAP使用Ksoap调用

时间:2015-05-31 04:19:55

标签: android soap ksoap2 android-ksoap2

我有一个SOAP Url http://seycel.com.mx/ws/res2.php我需要使用来自,origin,key word,timestamp的4个参数调用 deposito 方法。

我在尝试什么 -

private static final String SOAP_ACTION = "urn:recargas#recharge";
private static final String METHOD_NAME = "deposito";
private static final String NAMESPACE = "urn:recargas";
private static final String URL = "http://seycel.com.mx/ws/res2.php";

 public int GetInteger2() throws IOException, XmlPullParserException {
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

    PropertyInfo pi = new PropertyInfo();
    pi.setName("from");
    pi.setValue(9239392939);
    request.addProperty(pi);

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

    AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
    androidHttpTransport.call(SOAP_ACTION, envelope);

    SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
    return Integer.parseInt(result.toString());
}

但是从值中获取错误整数没有太大任何人都可以指导我如何使用 origin 值的那4个参数调用该方法它应该 1212121212

0 个答案:

没有答案