• 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
XML-RPC structs and case-sensitivity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XML-RPC structs and case-sensitivity


  • Subject: XML-RPC structs and case-sensitivity
  • From: Matt Deatherage <email@hidden>
  • Date: Wed, 21 Jul 2004 14:31:04 -0500

For some reason, my battles with case-sensitivity and AppleScript continue. :(

I need to call an XML-RPC method on a remote server with a single parameter of a <struct> that looks like this:

> <struct>
> <member>
> <name>Param1</name>
> <value><i4>56</i4></value>
> </member>
> <member>
> <name>Param2A</name>
> <value><string>my string here</string></value>
> </member>
> <member>
> <name>Param3b</name>
> <value><boolean>1</boolean></name>
> </member>
> </struct>

The way to do this in AppleScript is with a record:

> set myStruct to {Param1:56, Param2A:"my string here", Param3b:true}

Since this struct is the only parameter to the XML-RPC routine, I can call it fairly easily:

> tell application "http://www.example.com/RPC2";
> return call xmlrpc {method name:"method.Mine", parameters:myStruct}
> end tell

After a few hours of hair-tearing, I ran an Ethernet sniffer and saw the XML that AppleScript and/or WebServicesCore is emitting:

> <struct>
> <member>
> <name>param1</name>
> <value><i4>56</i4></value>
> </member>
> <member>
> <name>param2a</name>
> <value><string>my string here</string></value>
> </member>
> <member>
> <name>param3b</name>
> <value><boolean>1</boolean></name>
> </member>
> </struct>

It's subtle, but important: AppleScript or WebServicesCore has lowercased the name of every member of the struct. The XML-RPC spec says nothing about ignoring case, so this particular application (which I cannot modify) is case-sensitive, and fails. I have the member names with the correct case in my record, but AppleScript won't emit them that way. It correctly preserves the case of the method name, but that's a string and I expect that.

I haven't been able to find anything on the Web or in the list archives about this, though I can't really get the list archives to respond right now (I searched my local copy for the past year or so). Either I'm missing something or there's a major flaw in the XML-RPC implementation because it forces lowercase on XML that's supposed to be case-sensitive.

(And, just to eliminate the obvious, it still fails if wrapped in a "considering case" block.)

Any ideas?

--Matt
--
Matt Deatherage <email@hidden> <http://www.macjournals.com>
I read this list in digest mode; copy me privately for faster responses
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Problem getting position of desktop items
  • Next by Date: Re: Strange path
  • Previous by thread: Re: Strange path
  • Next by thread: Re: XML-RPC structs and case-sensitivity
  • Index(es):
    • Date
    • Thread