Hi
How can I post the following to a SOAP server.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="val not allow to post"
xmlns:xsd="val not allow to post"
xmlns:soap="val not allow to post">
<soap:Body>
<data>
<group>
<ROLE>Student</ROLE>
<NUMBER>1</NUMBER>
<PASSWORD></PASSWORD>
</group>
</data>
</soap:Body>
</soap:Envelope>
I had try to use the LibSOAP, but I can not make it to work and change it to make my SOAP server to response it.
Can anyone to point me the right direction?
I had try to use the Post command, but I can not figure out how to put " in my live code script.
I'm a beginner of Live code. So it seem it is hard to me to make it.
Regards
Terry Ho
Post information to a SOAP server
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Post information to a SOAP server
Disclaimer I dont use LiveCode with iOs.
So here is what i can tell you (on Windows).
-I've tried LibSOAP. No success.
-So I went the "classic" way.
You'll find one interesting stack here :
http://forums.runrev.com/phpBB2/viewtop ... =15#p55656
The important point is to set carefully.... you http header
In my case, the header i used :
Hope this could help.
So here is what i can tell you (on Windows).
-I've tried LibSOAP. No success.
-So I went the "classic" way.
You'll find one interesting stack here :
http://forums.runrev.com/phpBB2/viewtop ... =15#p55656
The important point is to set carefully.... you http header
Code: Select all
libURLSetCustomHTTPHeaders field "Header" ----put in this field your header
post leMessage to url "http://wwwwwwwwwwwwwwwwww" ----------- the URL of your webservice
put it into myResult ------------ the answer of the webservice
Code: Select all
POST /adxwsvc/services/CAdxSubProgramXml HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 2351 -----here you calculate the number of chars of your XML message
Host: wwwwww:18980
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Re: Post information to a SOAP server
Hi bangkok
Thanks your hints. I will take a look and try it.
Regards
Terry Ho
Thanks your hints. I will take a look and try it.
Regards
Terry Ho
Re: Post information to a SOAP server
Hi Terry,
1. the keyword QUOTE
...
put "<?xml version=" & QUOTE & "1.0" & QUOTE & "encoding=" & QUOTE & "utf-8" & QUOTE & "?>" into Line_1_of_xml
## -> <?xml version="1.0" encoding="utf-8"?>
...
2. or create a little function in the stack script that will save you a LOT of typing like this:
...
put "<?xml version=" & q("1.0") & "encoding=" & q("utf-8") & "?>" into Line_1_of_xml
## -> <?xml version="1.0" encoding="utf-8"?>
...
Best
Klaus
You can use:terryho wrote:... but I can not figure out how to put " in my live code script.
1. the keyword QUOTE
...
put "<?xml version=" & QUOTE & "1.0" & QUOTE & "encoding=" & QUOTE & "utf-8" & QUOTE & "?>" into Line_1_of_xml
## -> <?xml version="1.0" encoding="utf-8"?>
...
2. or create a little function in the stack script that will save you a LOT of typing like this:
Code: Select all
function q tString
return QUOTE & tString & QUOTE
end q
put "<?xml version=" & q("1.0") & "encoding=" & q("utf-8") & "?>" into Line_1_of_xml
## -> <?xml version="1.0" encoding="utf-8"?>
...

Best
Klaus