我正在向 .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/