SOLVED - Post to web service on iOS
Posted: Fri Aug 30, 2013 7:30 pm
Hello.
I'm trying to access a web service from iOS using post.
In the editor works fine but not on iOS, not in the simulator nor in the device.
It returns nothing, neither in it nor in the result.
I think it don't even try to send the request.
I'm trying to access a web service from iOS using post.
In the editor works fine but not on iOS, not in the simulator nor in the device.
It returns nothing, neither in it nor in the result.
I think it don't even try to send the request.
Code: Select all
-- Only needs a button with this code and a text field called 'consola'
local arrayListado
on mouseUp
put "borrado" into cd fld "consola"
Listado
end mouseUp
private command Listado
put "" into datosPeticion
put "<?xml version='1.0' encoding='utf-8'?>" \
& return & "<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/'>" \
& return & tab & "<soap:Body>" \
& return & tab & tab & "<Listado xmlns=" & quote & "http://ws.escrol.es/" & quote & " />" \
& return & tab & "</soap:Body>" \
& return & "</soap:Envelope>" \
into datosPeticion
set the httpHeaders to "POST /WebService.asmx HTTP/1.1" \
& return & "Host: ws.escrol.es" \
& return & "Content-Type: text/xml; charset=utf-8" \
& return & "Content-Length: " & the length of datosPeticion \
& return & "SOAPAction: http://ws.escrol.es/Listado"
put "petición iniciada" &cr&cr into field "consola"
post datosPeticion to url "http://ws.escrol.es/WebService.asmx"
put the result into resultado
put it into datosRespuesta
put "the result: " & resultado &cr&cr after field "consola"
put "it: " & datosRespuesta &cr&cr after field "consola"
put "petición terminada"&cr&cr after field "consola"
---
end Listado