通过 Android 连接 Soap Service 时出错

发布于 2024-12-25 08:21:14 字数 1400 浏览 0 评论 0原文

我想尝试(并且几乎崩溃)的是通过android连接到soap服务。这是我的代码:

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addPropterty("###", "###");
request.addProperty("user", "####");
request.addProperty("pwd", "####");

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

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
androidHttpTransport.debug = true;

androidHttpTransport.call(SOAP_ACTION, envelope);

SoapObject response = (SoapObject) envelope.getResponse();

String resultData = response.getProperty("ort").toString();

我的私人信息是:

private static String SOAP_ACTION = "http://tempuri.org/Finder/Finder/###";
private static String NAMESPACE = "http://tempuri.org/Finder/Finder/";
private static String METHOD_NAME = "get##XY";
private static String URL = "http://###.at/###/Finder/Finder.asmx";

在我想要获得响应的行中,我收到以下错误:

SoapFault - faultcode: 'soap:Server' faultstring: 'Server was unable to process request. ---> Value cannot be null.

我几乎尝试了所有内容并在论坛等中阅读了很多内容,但无法找到任何对我有帮助的内容。我尝试将 dotNet 变量设置为 true/false、androidHttpTransport.debug true/false、setXmlVersionTag yes/no...

任何人都可以帮助我吗?

What i want to try (and nearly flipping out) is to connect to a soap service via android. Here is my code:

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addPropterty("###", "###");
request.addProperty("user", "####");
request.addProperty("pwd", "####");

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

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
androidHttpTransport.debug = true;

androidHttpTransport.call(SOAP_ACTION, envelope);

SoapObject response = (SoapObject) envelope.getResponse();

String resultData = response.getProperty("ort").toString();

My privates are:

private static String SOAP_ACTION = "http://tempuri.org/Finder/Finder/###";
private static String NAMESPACE = "http://tempuri.org/Finder/Finder/";
private static String METHOD_NAME = "get##XY";
private static String URL = "http://###.at/###/Finder/Finder.asmx";

In the line where i want to get the Response, i get the following error:

SoapFault - faultcode: 'soap:Server' faultstring: 'Server was unable to process request. ---> Value cannot be null.

I nearly tried everything and read a lot in forums and so on but wasn´t able to find anything that helped me. I tried to set the dotNet variable to true/false, androidHttpTransport.debug true/false, setXmlVersionTag yes/no...

Can ANYBODY help me please?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文