Connecting Tech Pros Worldwide Help | Site Map

XML RPC transport error caused by authentication

Stefan Rijkaart
Guest
 
Posts: n/a
#1: Jul 17 '05
Hello,

has anyone experienced problems with XMLRPC library when trying to
connect through authentication?

I am calling a service on (example):
http:\\myuser:mypassword@awebsite.com/file/file.xml
And I get:
"Something went wrong - -32300 : transport error - HTTP status code
was not 200" I use the IXR_Library but also with another library I
have the same problem. In debug mode I see that PHP produces the XML
file for the request but it seems to have problems sending this to the
service. The service itself is ok, this is checked via another client
implementation.

Below the code I use.

Any suggestions? I think it is due to the userid password thing. When
calling on another service without a userid/password this code works
fine.

Regards
Stefan

<?php
include('IXR_Library.inc.php');

$par =
array("field1"=>"hello","field2"=>"world");

$client = new
IXR_Client('http:\\myuser:mypassword@awebsite.com/file/file.xml');

if (!$client->query('post', $par)) {
die('Something went wrong - '.$client->getErrorCode().' :
'.$client->getErrorMessage());
}


print_r ($client->getResponse());
echo "Done!";

?>
Daniel Tryba
Guest
 
Posts: n/a
#2: Jul 17 '05

re: XML RPC transport error caused by authentication


Stefan Rijkaart <stefanrv@xs4all.nl> wrote:[color=blue]
> I am calling a service on (example):
> http:\\myuser:mypassword@awebsite.com/file/file.xml
> And I get:
> "Something went wrong - -32300 : transport error - HTTP status code
> was not 200" I use the IXR_Library but also with another library I
> have the same problem. In debug mode I see that PHP produces the XML[/color]

No kidding, my guess there is no http request since the url is not
valid:
- username/password is officially not supported for http URL
- It's http:// not http:\\
[color=blue]
> Any suggestions? I think it is due to the userid password thing. When
> calling on another service without a userid/password this code works
> fine.[/color]

Look into packetsniffers to help debug these kind of network problems.
Ethereal is IMHO a good choice.

Closed Thread