Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Escaping 'password' in script?



(I'm an relatively experienced programmer but very new to Applescript.)

I'm writing a client application for Livejournal.com using their
XML-RPC interface, but I'm running into this snag:

tell application "http://livejournal.com/interface/xmlrpc";
  call xmlrpc {method name:"LJ.XMLRPC.postevent",
parameters:{userName:"quill18", password:"mypassword",
auth_method:"clear"}}
end tell

Where the label "password" is highlighted in blue - is it some kind of
reserved word?  Running this code results in
"http://livejournal.com/interface/xmlrpc got an error: Invalid
password (101)".

Watching the request in ethereal nets this:

<?xml version="1.0" encoding="UTF-8"?>
  <methodCall>
    <methodName>LJ.XMLRPC.postevent</methodName>
    <params>
      <param>
          <value>
            <struct>
              <member>
                <name>RApw</name>
                  <value>
                    <string>mypassword</string>
                  </value>
              </member>
              <member>
                <name>username</name>
                  <value>
                    <string>quill18</string>
                  </value>
              </member>
              <member>
                <name>auth_method</name>
                  <value>
                    <string>clear</string>
                  </value>
              </member>
            </struct>
          </value>
      </param>
    </params>
  </methodCall>

Notice that the name field for the password param is "RApw" instead of
"password".  How do I escape the "password" reserved word so it gets
passed correctly over XML-RPC?

P.S. The Applescript XML-RPC code is more or less copy-and-pasted from
other sources - I'm having a hard time finding proper documentation
for this sort of stuff.  Any recommendations?

-- 
Martin Glaude
email@hidden
http://deskslave.org/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.