• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "call soap" w/ authentication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >"call soap" w/ authentication (From: Laurent Humbert <email@hidden>)
 >Re: "call soap" w/ authentication (From: Adam Bell <email@hidden>)
 >Re: "call soap" w/ authentication (From: Laurent Humbert <email@hidden>)
 >Re: "call soap" w/ authentication (From: Adam Bell <email@hidden>)

  • Prev by Date: Re: Finder scripting bug
  • Next by Date: Re: "call soap" w/ authentication
  • Previous by thread: Re: "call soap" w/ authentication
  • Next by thread: Re: "call soap" w/ authentication
  • Index(es):
    • Date
    • Thread