?

Log in

No account? Create an account
trapped in livejournal factory; send help - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

trapped in livejournal factory; send help [Jun. 22nd, 2005|01:46 pm]
LiveJournal Client Discussions

lj_clients

[rly]

XML-RPC is pretty much the one thing I don't really know about XML and now here I am trying to use it to post to LJ with Coldfusion and it's not working.

<cfxml variable="LJxml"><methodCall>

<methodName>LJ.XMLRPC.postevent</methodName>

<params>
<param>
<value>
<struct>

<member><name>username</name>	<value><string>1justin_test</string></value></member>
<member><name>hpassword</name>	<value><string>lol no</string></value></member>

<member><name>subject</name>	<value><string>Test</string></value></member>
<member><name>event</name>	<value><string><![CDATA[This is a test post.]]></string></value></member>

<member><name>lineendings</name>	<value><string>pc</string></value></member>

<member><name>year</name>	<value><int>2002</int></value></member>
<member><name>mon</name>	<value><int>7</int></value></member>
<member><name>day</name>	<value><int>13</int></value></member>
<member><name>hour</name>	<value><int>20</int></value></member>
<member><name>min</name>	<value><int>35</int></value></member>

</struct>
</value>
</param>
</params>

</methodCall></cfxml>





<cfhttp 
  url = "http://www.livejournal.com/interface/xmlrpc"
  method = "POST"
>

<cfhttpparam 
  type = "XML"
  value = "#LJxml#"
>

</cfhttp>

Note that ColdFusion adds the <xml> tag by itself.

I ripped the XML straight from the documentation, and yet it says "failed during request deserialization: not well-formed (invalid token) at line 1, column 26, byte 26 at /usr/lib/perl5/XML/Parser.pm line 187" and that it's my own damned fault.

wtf

edit: FUCK IT NEVER MIND I'LL JUST USE flat INSTEAD BECAUSE IT WORKS

linkReply

Comments:
[User Picture]From: hythloday
2005-06-22 06:14 pm (UTC)
That's not even valid XML - it has more than one root element.

If you got rid of the cfhttp element, and removed the cfxml element so that the methodCall element was the root, then you might find that it worked.
(Reply) (Thread)
[User Picture]From: boggyb
2005-06-22 06:25 pm (UTC)
I thought that was the raw ColdFusion code. Certainly I know ColdFusion uses a xml-based syntax.
(Reply) (Parent) (Thread)
[User Picture]From: hythloday
2005-06-23 05:23 am (UTC)
Ah, I thought that was what was being sent to the server. Still, it sounds like the OP has found an alternative solution to his problem. :-)
(Reply) (Parent) (Thread)
[User Picture]From: rly
2005-06-23 12:20 am (UTC)
Like the other reply said, that's not XML, that's ColdFusion. CF code is all tag-based.
(Reply) (Parent) (Thread)
[User Picture]From: lanyingjie
2005-06-23 09:03 am (UTC)
Hey, go easy on the vulgarities.
(Reply) (Thread)
[User Picture]From: rly
2005-06-23 12:54 pm (UTC)
This is the internet. It's all swearing and naked ladies.
(Reply) (Parent) (Thread)