using KSOAP2 in accessing .net webservice

I am having trouble accessing a .net web service using soap service with package ksoap2.

The service url is

http://dsm.decisionality.com/MedicalDemo/MIB001FeelingUnwellservice.asmx

the location of wsdl file is

http://dsm.decisionality.com/MedicalDemo/MIB001FeelingUnwellservice.wsdl

i am trying to call the service GetVersion........i am using netbeans 5.5.1, sun java WTK 2.5 beta 2 in windows XP professional. I am trying to access by the following code ...

StringBuffer stringBuffer =new StringBuffer();

String method ="GetVersion ";

String url ="http://dsm.decisionality.com/MedicalDemo/MIB001FeelingUnwellservice.asmx";

// Create the SoapCall

SoapObject client =new SoapObject("urn:decisionality.com:webservices", method);

HttpTransport transport =new HttpTransport(url);

transport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

transport.debug =true;

// Creating the Soap Envelope

SoapSerializationEnvelope envelope =new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.dotNet =true;

envelope.bodyOut = client;

// Call the WebService

try

{

// namespace / method

transport.call("urn:decisionality.com:webservices/GetVersion", envelope);

}

catch (Exception io)

{

System.err.println(transport.requestDump);

System.err.println(transport.responseDump);

System.err.println(io);

return ;

}

// Format the Result

try{

String result = envelope.getResponse().toString();

stringBuffer.append("Result: " + result);

System.out.println(stringBuffer.toString());

}catch(Exception eee){

System.out.println(eee.toString());

}

please help me in this ........... my project is stuck for this thing... please some one help ...........

Riyad

[2834 byte] By [HybridBoya] at [2007-11-27 9:20:29]
# 1

the above code gives Parsing exception in J2ME but it works in J2SE .....

here is the code in J2SE ......

String url = "http://dsm.decisionality.com/MedicalDemo/MIB001FeelingUnwellservice.asmx";

StringBuffer stringBuffer = new StringBuffer();

String method = "GetBuildTime";

// Create the SoapCall

SoapObject client = new SoapObject("urn:decisionality.com:webservices", method);

HttpTransportSE transport = new HttpTransportSE(url);

// Creating the Soap Envelope

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.dotNet = true;

envelope.bodyOut = client;

// Call the WebService

try {

transport.call("urn:decisionality.com:webservices#GetBuildTime", envelope);

//System.out.println("2");

} catch (Exception io) {

System.err.println(io);

}

// Format the Result

try{

String result = envelope.getResponse().toString();

//System.out.println("GGGGGGGGGGGGGGGGGGGGGGGGG");

/*List a = (List)envelope.properties.values();

for(int i = 0 ; i < a.size();++i){

System.out.println(a.get(i));

}*/

stringBuffer.append("Result: " + result);

System.out.println(stringBuffer.toString());

}catch(Exception exx){

System.out.println(exx.toString());

}

now i want to know if more than one value is returned as a response of the server example a string , a int , a double is returned, how to get the value? previously getProperty() function was used in ksoap version 1.2. how to do it now using ksoap2 ?

bye

Riyad

HybridBoya at 2007-7-12 22:13:39 > top of Java-index,Java Mobility Forums,Java ME Technologies...