php_xmlrpc_decode() doesn't return anything
"Bosky, Dave" <[email protected]> Tue, 21 Aug 2007 11:51:48 -0400
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
The method executes perfect and does what it should. But it always
returns a 'XML error at line 1, check URL' at the end if it works.
I've got debug mode set to 2 to show everything.
I'm not sure what to do since it works but I need to extract the 'id'
field returned.=20
The php_xmlrpc_decode() doesn't return anything if I move it outside or
inside the if statement.
Can anyone see something I'm doing wrong? Thanks Again.
*************************
Here's my code.
*************************
include("xmlrpc.inc");
$xmlrpc_client =3D new xmlrpc_client('x.pl','00.00.00.00',443);
$xmlrpc_client->setDebug(2);
$xmlrpc_client->setSSLVerifyPeer(0);
$xmlrpc_client->setSSLVerifyHost(0);
$xmlrpc_client->setCredentials('user','pas');
$xmlrpc_client->setProxy('proxy.com', '8080', '', '', 1);
$xmlrpc_msg =3D new xmlrpcmsg('create.entry');
$xmlrpc_msg->addParam(new xmlrpcval('id','string'));
$xmlrpc_msg->addParam(new xmlrpcval(0,'int'));
=09
$xmlrpc_resp =3D $xmlrpc_client->send($xmlrpc_msg,40,"https");=20
// $decoded_response =3D php_xmlrpc_decode($xmlrpc_resp->value());
// print "resp: ".$decoded_response;
if ($xmlrpc_resp->faultCode()) {
$decoded_response =3D php_xmlrpc_decode($xmlrpc_resp->value());
print "decode: ".$decoded_response;
} else {
print "<BR>Fault: Code: ".$xmlrpc_resp->faultCode();
print "<BR>Reason '".$xmlrpc_resp->faultString()."'<BR>";
}
*************************
Here's the dump.
*************************
---SENDING---
<?xml version=3D"1.0"?>
<methodCall>
<methodName>create.entry</methodName>
<params>
<param>
<value><string>id</string></value>
</param>
<param>
<value><int>111</int></value>
</param>
</params>
</methodCall>
---END---
---GOT---
HTTP/1.0 200 Connection established
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Tue, 21 Aug 2007 15:40:09 GMT
Server: Apache
MIME-version: 1.0
P3P: policyref=3D"/w3c/p3p.xml", CP=3D"Content-Length: 402"
Connection: close
Transfer-Encoding: chunked
Content-Type: text/xml
<?xml version=3D"1.0"?>
<methodResponse>
<params>
<param><value><struct>
<member><name>error</name><value><i4>0</i4></value></member>
<member><name>id</name><value><i4>111</i4></value></member>
<member><name>message</name><value><string>Added
entry</string></value></member>
</struct></value>
</param>
</params>
</methodResponse>
---END---
XML error at line 1, check URL
Thanks,
=20
Dave Bosky | Information Services | HTC | direct: 843-369-8613 | fax:
843-369-7178 | [email protected]
**********************************************************************
HTC Disclaimer: The information contained in this message may be privilege=
d and confidential and protected from disclosure. If the reader of this mes=
sage is not the intended recipient, or an employee or agent responsible for=
delivering this message to the intended recipient, you are hereby notified=
that any dissemination, distribution or copying of this communication is s=
trictly prohibited. If you have received this communication in error, plea=
se notify us immediately by replying to the message and deleting it from yo=
ur computer. Thank you.
**********************************************************************