Problem WebService

tamayo461

Member
Licensed User
Longtime User
Please I need some help with a webservice, it has two methods:
"Consultar" and "Respuesta", "Consultar" not receive parameters and delivers a string of 200 characters and "Respuesta" send the following response parameters (String respuesta, float latitud, float longitud, float altura);
the direction of Webservice is "http://www.xxxxxxxxx.asmx"

Something simple to understand, a button to initiate the consultation and followed it to send the response.

If you could help me a bit with that would appreciate, is that the examples I saw none applies Forum and truth have never managed webService.

Thank you

:BangHead:.
 

tamayo461

Member
Licensed User
Longtime User
Internal server error

'Activity module
Sub Process_Globals

Dim job2 As HttpJob
Dim url As String
url = "http://www.concesionesdeaseo.com/ServicioConsulta/lib/servicio/SERDatos.asmx"
Dim RequestSoapXML As String

End Sub

Sub Globals
Dim etxRespuesta As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")

RequestSoapXML = _
"<?xml version='1.0' encoding='utf-8'?>" & _
"<soap12:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://www.w3.org/2003/05/soap-envelope'>" & _
"<soap12:Body>" & _
"<ConsultarResponse xmlns='Servicio'>" & _
"<ConsultarResult>string</ConsultarResult>" & _
"</ConsultarResponse>" & _
"</soap12:Body>" & _
"</soap12:Envelope>"
job2.Initialize(job2,Me)
job2.PostString(url,RequestSoapXML)
job2.GetRequest.SetHeader("Content-Type", "text/xml; charset=utf-8")
job2.GetRequest.SetHeader("Servicio/Consultar" , "http://www.concesionesdeaseo.com/ServicioConsulta/lib/servicio/SERDatos.asmx/Consultar")
Msgbox(job2.JobName,"titulo")

End Sub

Sub JobDone (job As HttpJob)
'Log("JobName = " & job.JobName & ", Success = " & job.Success)
'Msgbox("JobName = " & job.JobName & ", Success = " & job.Success,"")
If job.Success = True Then
Msgbox(job.GetString,"")
Else
'Log("Error: " & job.ErrorMessage)
ToastMessageShow("Error: " & job.ErrorMessage, True)
End If
job.Release
End Sub

----------------------------------------------------------------

Where is the error????

Internal Server Error

and the JobName in the image...
 

Attachments

  • SC20121128-144901.png
    SC20121128-144901.png
    45.3 KB · Views: 246
Upvote 0

tamayo461

Member
Licensed User
Longtime User
Solved!!!!

Solved!!
Published the code in case anyone has problems with WebService ...
------------------------------------------------------------
Sub btnConsultar_Click
RequestSoapXML = _
"<?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>" & _
"<Consultar xmlns='Servicio'/>" & _
"</soap:Body>" & _
"</soap:Envelope>"
job2.PostString(url,RequestSoapXML)
job2.GetRequest.SetHeader("Content-Type", "text/xml; charset=utf-8")
End Sub

Sub btnEnviar_Click
RequestSoapXML = _
"<?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>" & _
"<Respuesta xmlns='Servicio'>" & _
"<respuesta>" & etxRespuesta.Text & "</respuesta>" & _
"<latitud>" & lblLat.Text & "</latitud>" & _
"<longitud>" & lblLon.Text & "</longitud>" & _
"<altura>" & lblAlt.Text & "</altura>" & _
"</Respuesta>" & _
"</soap:Body>" & _
"</soap:Envelope>"
job2.PostString(url,RequestSoapXML)
job2.GetRequest.SetHeader("Content-Type", "text/xml; charset=utf-8")
End Sub

Sub JobDone (job As HttpJob)
'Msgbox("JobName = " & job.JobName & ", Success = " & job.Success,"")
If job.Success = True Then
Msgbox(job.GetString,"")
'lblConsultar.Text = job.GetString
ToastMessageShow("Succes= " & job2.Success, True)
Else
'Log("Error: " & job.ErrorMessage)
ToastMessageShow("Error: " & job.ErrorMessage, True)
End If
job.Release
End Sub
 
Upvote 0
Top