Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I parse a .net DataSet in Java?

I am sending a simple soap request to a .net webservice. However the response returned is a .net dataset. Is it possible to read a .net DataSet in java?
Below is the soap request I am using and how I am trying to read the response:

    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();
like image 880
Jon Wells Avatar asked Feb 25 '26 04:02

Jon Wells


2 Answers

You should use soap service like below.

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

for more reference visit Android and .NET Webservice - parsing the returned xml

like image 102
Ravi Bhatt Avatar answered Feb 27 '26 16:02

Ravi Bhatt


Having done some more research this question is answered on this site already:

Parsing a .NET DataSet returned from a .NET Web Service in Java

like image 21
Jon Wells Avatar answered Feb 27 '26 16:02

Jon Wells