Re: fatal error when trying to use structmem();
"I Wayan Yuliarta" <[email protected]> Fri, 13 Oct 2006 06:31:40 -0000
| Newsgroups | gmane.text.xml.rpc.specification |
|---|---|
| Message-ID | <[email protected]> |
Hi there barnbroker...
The return value from xmlrpc_decode is a PHP value, usually is an
array value or a scalar value.
From the code, the $myList value is an associative array not an object.
Change the following codes :
$vidTitle = $myList->structmem('Host');
$Host = $vidTitle->scalarval();
echo $Host;
To :
$Host = $myList['Host'];
echo $Host;
Good Luck,
Wayan
--- In [email protected], "barnbroker" <rob.bowers@...> wrote:
>
> Here's my php code:
>
> <?php
> require_once('xmlrpc/xmlrpc.inc');
> $xmlrpc_msg = new xmlrpcmsg('examples.getallheaders');
> $vidClient = new
> xmlrpc_client('/server.php','phpxmlrpc.sourceforge.net',80);
> $resp = $vidClient->send($xmlrpc_msg);
> if (!$resp->faultCode()) {
> $myList = xmlrpc_decode($resp->value());
> $vidTitle = $myList->structmem('Host');
> $Host = $vidTitle->scalarval();
> echo $Host;
> } else {
> printf($resp->faultCode());
> }
> ?>
>
> When I try to run this I get a fatal error:
>
> Fatal error: Call to a member function on a non-object in
> /home/virtual/site303/fst/var/www/html/rpc_test.php on line 8
>
> Line 8 is:
>
> $vidTitle = $myList->structmem('Host');
>
>
>
> Any ideas why this might be happening?
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/xml-rpc/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/xml-rpc/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/