Jump to content

Assistance needed with xmlrpc


GoodVibe
 Share

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
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.