?

Log in

No account? Create an account
Hi, All! I'm trying to use XML-RPC protocol. It's works ok with… - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

[Oct. 7th, 2004|06:30 pm]
LiveJournal Client Discussions
lj_clients
[8eyes]
Hi, All!

I'm trying to use XML-RPC protocol.
It's works ok with test.livejournal.org, but I havn't got _any_ reply from
www.livejournal.com. Both requests are equal, except Host, Content-Length and
password.

What shoult I do?
linkReply

Comments:
[User Picture]From: marksmith
2004-10-07 08:49 am (UTC)
Well, show us your request! (Sans password.)

If you're really having an issue with one to test.lj working but www.lj not working, it's very likely something to do with Perlbal, and needs to be fixed.

But I can't do that without seeing what you're sending. :)
(Reply) (Thread)
From: 8eyes
2004-10-07 09:55 am (UTC)
I'm using XML-RPC docs and examples.

Here is data, that actually was sent to socket.
I can't retest requests just now, because test.livejournal.org is down.
Tabs switched with spaces.

test.lj:
===
POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
Host: test.livejournal.org
Content-Type: text/xml
Content-Length: 642

[?xml version="1.0"?]
[methodCall]
[methodName]LJ.XMLRPC.sessiongenerate[/methodName]
[params]
[param]

[value][struct]
[member][name]username[/name]
[value][string]8eyes[/string][/value]
[/member]
[member][name]password[/name]

[value][string]XXXXXXXX[/string][/value]
[/member]
[member][name]ver[/name]
[value][int]1[/int][/value]

[/member]
[member][name]expiration[/name]
[value][string]long[/string][/value]
[/member]

[member][name]ipfixed[/name]
[value][string]1[/string][/value]
[/member]

[/struct][/value]
[/param]
[/params]
[/methodCall]
===

www.lj:
===
POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
Host: www.livejournal.com
Content-Type: text/xml
Content-Length: 646

[?xml version="1.0"?]
[methodCall]
[methodName]LJ.XMLRPC.sessiongenerate[/methodName]
[params]
[param]

[value][struct]
[member>[name>username[/name]
[value>[string>8eyes[/string>[/value]
[/member]
[member][name>password[/name]

[value][string]XXXXXXXXXXXX[/string>[/value]
[/member]
[member][name>ver[/name]
[value][int>1[/int>[/value]

[/member]
[member][name]expiration[/name]
[value][string]long[/string][/value]
[/member]

[member][name]ipfixed[/name]
[value][string]1[/string][/value]
[/member]

[/struct][/value]
[/param]
[/params]
[/methodCall]
===

With test.lj I have a reply with cookie.
With www.lj I have nothing.
I also trying another methods with same results.

(Reply) (Parent) (Thread)
[User Picture]From: xb95
2004-10-07 07:14 pm (UTC)
If you're getting no reply, it sounds like you have issues with the content-length being wrong?
(Reply) (Parent) (Thread)
From: 8eyes
2004-10-08 02:59 am (UTC)
Well...
test.lj: Content-Length: 642
www.lj: Content-Length: 646

Yes. Difference only in 4 bytes. Bacause my www.lj's password little longer.
Carriage return is unix-like. (0x0a, not 0x0d0a).
Content-Length calculated in vim, using ":'<,'>!wc -c"
It's working method, because I use it in other my programs (tested on apache, thttpd), that used http transport for XML
(with PUT and GET http-methods).
Look here:
===
--- test2.xml Fri Oct 8 12:53:54 2004
+++ test3.xml Fri Oct 8 12:52:02 2004
@@ -1,8 +1,8 @@
POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
-Host: test.livejournal.org
+Host: www.livejournal.com
Content-Type: text/xml
-Content-Length: 642
+Content-Length: 646

[?xml version="1.0"?]
[methodCall]
@@ -16,7 +16,7 @@
[/member]
[member][name]password[/name]

- [value][string]XXXXXXXX[/string][/value]
+ [value][string]XXXXXXXXXXXX[/string][/value]
[/member]
[member][name]ver[/name]
[value][int]1[/int][/value]

===


So... even if Content-Length is wrong calculated... Why test.lj gave me reply? Can you write a working example for me ?

(Reply) (Parent) (Thread)
[User Picture]From: hyuri
2004-10-08 03:32 am (UTC)
I find it very interesting that that command gives you 646, since turning on column-number-mode in Emacs and adding the numbers manually comes up to 552 using Unix line‑endings. And when I threw it into Vim just now, I got 553.

Are you including any of the headers in your visual selection?
(Reply) (Parent) (Thread)
From: 8eyes
2004-10-08 04:18 am (UTC)
No. Headers are not included in selection.
Lets trying to calculate length using "ls" utility.
Total file length: 778 bytes
Request only, saved in separate file: 646 bytes
Headers only with empty line, saved in separate file: 132 bytes
132+646 = 778

I can sent this file to you by e-mail, so you can recheck my calculations.
(Reply) (Parent) (Thread)
[User Picture]From: hyuri
2004-10-08 04:48 am (UTC)
It would certainly help. I’ve been using this file for calculation (copied your listing and changed [] to <>), and ls -l says it’s 685 bytes.
(Reply) (Parent) (Thread)
From: 8eyes
2004-10-08 06:12 am (UTC)
I sent in to you e-mail, listed in your userinfo.
(Reply) (Parent) (Thread)
From: 8eyes
2004-10-08 06:22 am (UTC)
It seems, that some spaces diappears while I usign "cut and paste" technogy :-)
(Reply) (Parent) (Thread)
From: 8eyes
2004-10-08 08:23 am (UTC)
I just run tests for file you linked, using both Content-Length values calculated by you. I still got nothing.
I think this is not Content-Length or request problem.
It seems to be a www.lj problem.

Can you write any working example for me?
Can you run my tests in your environment?

(Reply) (Parent) (Thread)