我正在开发一个带有soap服务的android应用程序。但是,当我添加请求属性时它不起作用。我错过了什么吗?对象referans没有设置ksoap2
public class WebServiceCallerImp {
private static final String METHOD_NAME = "GetForexStocksandIndexesInfo";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String SOAP_ACTION = "http://tempuri.org/GetForexStocksandIndexesInfo";
private static final String URL = "http://mobileexam.veripark.com/mobileforeks/service.asmx";
public static String GetForex() {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("IsIPAD", "true");
request.addProperty("DeviceID", "test");
request.addProperty("DeviceType", "ipad");
request.addProperty("RequestKey", "%%UmVxdWVzdElzVmFsaWQyNzowNDoyMDE3IDEzOjEy%%");
request.addProperty("Period", "Month");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.getResponse();
System.out.println("output: " + response.toString());
return response.toString();
} catch (Exception e) {
System.out.println("@@@@: " + e.toString());
}
return "null";
}
响应
Object reference not set to an instance of an object. at Denizbank.IpadApplication.Integration.ForexIntegration.StocksandIndexes.GetForexStocksandIndexesInfo(StocksandIndexesRequest req)
在Denizbank.IpadApplication.Service.Service.GetForexStocksandIndexesInfo(StocksandIndexesRequest请求)
SOAP请求
我在哪里犯错?请帮帮我。
我想问题与 删除那一个。因为你没有启动该标记,只把完成标记部分。 –
thanx安迪,但没有工作 –
看到我的答案它适用于我。我做这件事,它适用于我。 –