Hi, For getting response the webservice use the following
Object result=envelope.getResponse(); Log.d(TAG, "Result: " + result.toString()); Regards, SathishBabu. S On Tue, May 10, 2011 at 7:20 PM, Gorka <[email protected]> wrote: > Hi, > > I am trying to access to a web service using SOAP using the ksoap2 > libraries. The thing is that I can make some examples work, but I > cannot access the service I am interested in. > > There is the service: http://apli.bizkaia.net/APPS/DANOK/TQWS/TQ.ASMX > And that is the method I want to consult: > http://apli.bizkaia.net/APPS/DANOK/TQWS/TQ.ASMX?op=GetPasoParada > > Sort description > > POST /APPS/DANOK/TQWS/TQ.ASMX HTTP/1.1 > Host: apli.bizkaia.net > Content-Type: text/xml; charset=utf-8 > Content-Length: length > SOAPAction: "http://tempuri.org/LANTIK_TQWS/TQ/GetPasoParada" > > <?xml version="1.0" encoding="utf-8"?> > <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http:// > schemas.xmlsoap.org/soap/envelope/"> > <soap:Body> > <GetPasoParada xmlns="http://tempuri.org/LANTIK_TQWS/TQ"> > <strLinea>string</strLinea> > <strParada>string</strParada> > </GetPasoParada> > </soap:Body> > </soap:Envelope> > > That is my code: > > private static final String SOAP_ACTION = "http://tempuri.org/ > LANTIK_TQWS/TQ/GetPasoParada"; > private static final String METHOD_NAME = "GetPasoParada"; > private static final String NAMESPACE = "http://tempuri.org/ > LANTIK_TQWS/TQ/"; > private static final String URL = "http://apli.bizkaia.net/APPS/DANOK/ > TQWS/TQ.ASMX"; > > SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //set up > request > request.addProperty("strLinea", "*"); //variable name, value. I got > the variable name, from the wsdl file! > request.addProperty("strParada", "48036029"); //variable name, value. > I got the variable name, from the wsdl file! > SoapSerializationEnvelope envelope = new > SoapSerializationEnvelope(SoapEnvelope.VER11); //put all required data > into a soap envelope > envelope.setOutputSoapObject(request); //prepare request > envelope.dotNet = true; > HttpTransportSE httpTransport = new HttpTransportSE(URL); > > try { > httpTransport.call(SOAP_ACTION, envelope); > } catch (IOException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } catch (XmlPullParserException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } //send request > > SoapObject result=(SoapObject)envelope.bodyIn; > Log.d(TAG, "Result: " + result.toString()); > > The thing is that I don“t get any response. Well, actually I do, but > it is an error message: > GetPasoParadaResponse{GetPasoParadaResult=Object reference not set to > an instance of an object.;} > > It would be great if someone knows how can I solve my problem. > > Thanks a lot, Gorka > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

