Re: "call soap" w/ authentication
Re: "call soap" w/ authentication
- Subject: Re: "call soap" w/ authentication
- From: Laurent Humbert <email@hidden>
- Date: Mon, 16 Jan 2006 07:52:14 +0100
I managed to get things to work using curl.
Here's what the script looks like for a public web service. To connect
to a http server that requires authentication, just add the line:
set theCmd to theCmd & space & "-u theusername:thepassword"
------
set theSOAPAction to "Soapaction:
\\\"http://swanandmokashi.com/GetQuote\\\""
set theCmd to "curl --header \"Content-type: text/xml\""
set theCmd to theCmd & space & "--header \"" & theSOAPAction & "\""
set theCmd to theCmd & space & " --data \""
set theCmd to theCmd & space & "<?xml version=\\\"1.0\\\"
encoding=\\\"UTF-8\\\"?>" & return
set theCmd to theCmd & space & "<SOAP-ENV:Envelope" & return
set theCmd to theCmd & space &
"xmlns:xsd=\\\"http://www.w3.org/1999/XMLSchema\\\"" & return
set theCmd to theCmd & space &
"xmlns:xsi=\\\"http://www.w3.org/1999/XMLSchema-instance\\\"" & return
set theCmd to theCmd & space &
"SOAP-ENV:encodingStyle=\\\"http://schemas.xmlsoap.org/soap/encoding/
\\\"" & return
set theCmd to theCmd & space &
"xmlns:SOAP-ENV=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\"" &
return
set theCmd to theCmd & space &
"xmlns:SOAP-ENC=\\\"http://schemas.xmlsoap.org/soap/encoding/\\\">" &
return
set theCmd to theCmd & space & "<SOAP-ENV:Body>" & return
set theCmd to theCmd & space & "<m:GetQuote
xmlns:m=\\\"http://www.swanandmokashi.com\\\">" & return
set theCmd to theCmd & space & "</m:GetQuote>" & return
set theCmd to theCmd & space & "</SOAP-ENV:Body>" & return
set theCmd to theCmd & space & "</SOAP-ENV:Envelope>\""
set theCmd to theCmd & space &
"http://www.swanandmokashi.com/HomePage/WebServices/QuoteOfTheDay.asmx"
set theCmd to theCmd & return
set theResut to do shell script theCmd
-------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden