• 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: Soap and Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Soap and Applescript


  • Subject: Re: Soap and Applescript
  • From: Stan Cleveland <email@hidden>
  • Date: Mon, 17 Jan 2011 13:10:56 -0800

On Jan 16, 2011, at 1:46 PM, Bernardo Hoehl wrote:

I am trying to use applescript to talk to a webservice using the XML-RPC and SOAP Protocols as it is described here:

http://developer.apple.com/library/mac/#documentation/AppleScript/Conceptual/soapXMLRPC/chapter3/soapXMLRPC_scripts.html#//apple_ref/doc/uid/20001723-DontLinkElementID_13

No matter what service I try to talk to it returns me always:

error "soap got an error: Transport error" number -916

Hi Bernardo,

That's a familiar error. Several years ago, I fought with AS's implementation of SOAP and nearly gave up. Finally, I figured out the correct format for SOAP calls. For example, here's a simple example using a silly, but free, SOAP service:

tell application "http://greg.froh.ca/fun/random_bushism/soap/index.php"
set soapResult to call soap {method name:"getRandomBushism", method namespace uri:¬
"urn:RandomBushism", SOAPAction:"urn:RandomBushism#bushism#getRandomBushism"}
end tell

And here's a more complex, but imaginary, SOAP call for employee information:

tell application "https://somewhere.com/worker_web_service/api"
set dataRecord to call soap {method name:"GetInfo", parameters:¬
{Account:{username:"stanc", |password|:"blah"}, EmployeeInfo:¬
{|name|:fullName, position:jobTitle, salary:payRate}} ¬
, method namespace uri:"urn:ActionWebService", SOAPAction:¬
"/worker_web_service/api/GetInfo"}
end tell

Nesting is important. Note that the method name, parameters, method namespace uri, and SOAPAction are in a record that follows the call soap command. The parameters element is itself a nested record that contains nested records. Also note that the tell application target and the method name and SOAPAction parameters all share various bits of the desired URL, but none of the three contain the complete URL.

The above is the format that worked with the service I was accessing at the time. I don't fully understand all the parts—I just know that it works. [FYI, in case the code gets hammered in transit, each example has only three lines: The call soap is in one line between the tell application and end tell lines.]

HTH,
Stan C.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Soap and Applescript (From: Bernardo Hoehl <email@hidden>)

  • Prev by Date: Re: Convert Text to Variable Name
  • Next by Date: Re: AppleScript-Users Digest, Vol 8, Issue 44
  • Previous by thread: Re: Soap and Applescript
  • Next by thread: Re: Soap and Applescript
  • Index(es):
    • Date
    • Thread