Jump to content

Assistance needed with xmlrpc


GoodVibe

Recommended Posts

Hows it going guys. Well, I'm trying to create an app tat deals with the barracuda API. Unfortunately it uses all XML for its methods, so I had to come up with this:

 

<?php
include ("xmlrpc.inc");
$y = new xmlrpcval (
    array ("child_type" => new xmlrpcval("domain", "string"), "path" => new xmlrpcval("", "string"),"type" => new xmlrpcval("global", "string"))
    , "struct");
$m = new xmlrpcmsg ('config.list');
$m ->addParam($y);
$c= new xmlrpc_client("http://barracudaaddress/cgi-mod/index.cgi?password=mypassword");
$c->setDebug(2);
$r = $c ->send($m);
if (!$r->faultcode()) {
    $v= $r->value();
    print $r->serialize();
} else {
    print "Fault <br/>";
    print "Code: ". htmlentities($r->faultcode()) . "<br/>" .
            "reason: '" . htmlentities($r->faultString()) . "'<br/>";
}
?>

 

the problem is that when I run this, i get the following error:

XML error: XML_ERR_NAME_REQUIRED at line 2, column 61Fault
Code: 2
reason: 'Invalid return payload: enable debugging to examine incoming payload (XML error: XML_ERR_NAME_REQUIRED at line 2, column 61)'

 

but when i look at my php code, line 2 is technically:

include ("xmlrpc.inc");

 

Does this mean my error is coming from that file? Because as far as I can tell, the XML output is working well, since this is what is getting sent to the server:

<?xml version="1.0"?>
<methodCall>
<methodName>config.list</methodName>
<params>
<param>
<value><struct>
<member><name>child_type</name>
<value><string>domain</string></value>
</member>
<member><name>path</name>
<value><string></string></value>
</member>
<member><name>type</name>
<value><string>global</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>

 

Which is what is required for this method. I've racked my brain and can't figure it out, any help would be appreciated.

 

Link to comment
https://forums.phpfreaks.com/topic/258593-assistance-needed-with-xmlrpc/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.