Page 2 of 2

Re: Post to web service on iOS

Posted: Sun Sep 01, 2013 9:02 pm
by Simon
Ok I have a workaround that consistently returns the correct information:

Code: Select all

-- Only needs a button with this code and a text field called 'consola'

local arrayListado
on mouseUp
put url "http://www.google.com" into temp --NEW LINE
   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"
   
set the httpHeaders to empty --NEW LINE
   ---
end Listado
That first "put url..." stinks! I don't understand why that would be needed. :x
Setting the httpHeaders to empty makes some sense.

All I can say is that with those two additional lines the code does work consistently in the sim.

Simon :x

Re: Post to web service on iOS

Posted: Sun Sep 01, 2013 9:29 pm
by viro
And if nothings works for you try to download a restclient for your ipad and figure the post step by step. transfer your results into lv and bäm!

Re: Post to web service on iOS

Posted: Mon Sep 02, 2013 12:02 am
by juanjo
Hi Simon,

I tried similar things too.
I tried as you say… and I obtain the contents of Google, instead of mine ?!

Seems that my Post is ignored.
I'll try more tomorrow. Is late here.


Viro:
Thanks, good idea: I'll search for some soap client for iPad.
 

Re: Post to web service on iOS

Posted: Mon Sep 02, 2013 12:27 am
by Simon
Yeah, my bad!
I screwed up in the above code :x

Simon

Re: Post to web service on iOS

Posted: Mon Sep 02, 2013 1:06 pm
by LCNeil
Hi JuanJo et al.

This issue seems to be a bug in iOS deployment. I have tested your supplied code on desktop and Android environments without any issues and can constantly replicate the empty results on iOS.

As this is the case, I would recommend filing a bug report on the issue with RunRev Quality Control.

Filing a report with Quality Control is the best way to allow our team to investigate the issues further and implement a fix if needed. As you are filing the report you will automatically receive status updates on it via email.

Our quality control centre is available here-

http://quality.runrev.com

You will need to log-in with a RunRev Quality Control Account before you can submit a report. If you do not already have one, you will be able to create an account via the "New Account" option shown on the Quality Control homepage.

Kind Regards,

Neil Roger

--
RunRev Support Team ~ http://www.runrev.com
--

Re: Post to web service on iOS

Posted: Mon Sep 02, 2013 1:44 pm
by juanjo
Hi Neil.

I'll do as you said.
Thanks to you, Simon and Viro for your kind attention and help.

Re: Post to web service on iOS

Posted: Mon Sep 02, 2013 7:13 pm
by Simon
Oh Good!
I thought I was going crazy. I tried it on Android as well and saw it was working.

juanjo, when you file the report could you post the bug report number here so I can follow it?

Thanks,
Simon

Re: Post to web service on iOS

Posted: Mon Sep 02, 2013 8:31 pm
by juanjo
Simon wrote:juanjo, when you file the report could you post the bug report number here so I can follow it?
Sure!

Now I'm with the plan B…
I'll do it soon.

Re: Post to web service on iOS

Posted: Wed Sep 11, 2013 5:35 pm
by juanjo
I filed the bug and I have responded:
(…)
The post command is failing on iOS due to the unexpected inclusion of "POST ..." in the first line of httpheaders.

I recommend you remove this line from httpheaders as it will be automatically generated when a request is sent using the post command. Removing this line will fix the issue of post not working on iOS.

There is a bug here, as obviously the behavior on the desktop is different from that on mobile. It should be possible to set the http command used in this way on iOS.

Ian.
I tested it and works well!

Re: SOLVED - Post to web service on iOS

Posted: Wed Sep 11, 2013 8:04 pm
by Simon
Great News!

Now how am I going to remember this?

Simon

Re: SOLVED - Post to web service on iOS

Posted: Wed Sep 11, 2013 8:13 pm
by juanjo
Mm… don't post 'post' in the post?