gpt4 book ai didi

java - 如何在 Java 中解析 .net DataSet?

转载 作者:太空狗 更新时间:2023-10-29 12:55:48 25 4
gpt4 key购买 nike

我正在向 .net 网络服务发送一个简单的 soap 请求。但是,返回的响应是 .net 数据集。是否可以在 java 中读取 .net 数据集?
下面是我正在使用的 soap 请求以及我如何尝试读取响应:

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //Set up request
request.addProperty("Account", "****"); //Variable name, value.
request.addProperty("Name", "****");
request.addProperty("Password", "****");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request); //Prepare the request
HttpTransportSE HttpTransport = new HttpTransportSE(URL);
HttpTransport.debug = true;

HttpTransport.call(SOAP_ACTION, envelope); //Send Request
SoapObject result = null;
result = (SoapObject)envelope.getResponse();

result.toString();

最佳答案

你应该像下面这样使用 soap 服务。

SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.dotNet=true;//to handle .net services asmx/aspx

更多引用请访问Android and .NET Webservice - parsing the returned xml

关于java - 如何在 Java 中解析 .net DataSet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6984371/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com