SOAP - Problem with separate threads
Mark Smith
mark at maseurope.net
Fri Oct 26 19:53:50 EDT 2007
Dave, I'm not sure how useful my own code for this would be, as it
makes quite a few interlinked function calls, but the gist is that it
builds the request and puts it (urlEncoded) into a temp file (see
docs for 'the tempName'), builds up a command string for curl, does
the post, gets the response and then deletes the temp file.
The curl options I use are '-s' to keep curl from putting it's own
info at the start of the response, '-H' to set an HttpHeader, '--data-
binary' to tell it to post the tempfile ('@' at the start of the file
name). So the command looks like this:
curl -s -H "Content-Type: text/xml; charset=utf8" -H "SOAPAction: !
requestname!" --data-binary "@!the request!" !the endpoint!
where !requestname! is the SOAP method, !therequest! is the temp
file, and !endpoint! is the url to post to.
Writing the soap request out to a file doesn't seem to slow things
down, I'm getting an average round trip in 300 to 400 ms.
I don't know if libCurl is generally installed as a command-line tool
on Windows, but it's part of the standard installation on OS X, and
on Linux, I'd imagine.
The reason I started using curl for this was that the service I'm
using is an https service, and libURL was timing out as often as not.
Dave Cragg has narrowed the problem down to a secure-socket-related
issue, I think, rather than a fault with libURL itself. I haven't had
a single time-out using curl with this service.
Hope this helps,
Best
Mark
On 26 Oct 2007, at 20:42, Dave wrote:
> Hi,
>
> Yes, I use the post command. Will curil work on Mac and Windows? I
> took a look at curl, but I can't figure how to use it to send and
> receive a soap command. This the code I use:
>
> --
> -- Post the Request
> --
> try
> set the HTTPHeaders to myHTTPHeader
> --libUrlSetSSLVerification false
> post mySOAPEnvelope to url mySoapURL
>
> --
> -- Catch Time-Out Errors
> --
> catch myError
> answer myError
> breakpoint
> end try
>
> --
> -- Retreive Results and Store in the Response Array
> --
> put it into mySoapReply
> put the result into mySoapResponse
>
> How can I do the same thing using "curl".
>
> Thanks a lot for the help
> All the Best
> Dave
>
> On 26 Oct 2007, at 18:47, Mark Smith wrote:
>
>> I imagine that you're POSTing the SOAP calls to the server, so you
>> could try using curl shell commands for the POSTs - that way, your
>> SendSoapCommands will not return until they have got a response.
>>
>> Best,
>>
>> Mark
>>
>> On 26 Oct 2007, at 18:49, Dave wrote:
>>
>>> So what I want is for SendSoapCommandX() to NOT return until the
>>> data has been transfered and the reply received.
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list