R: [phpxmlrpc] getting results from server ok but!
Gaetano Giunta
giunta.gaetano at sea-aeroportimilano.it
Fri Dec 19 16:29:09 GMT 2003
A very handy function you can ofetn make use of is
$arr=xmlrpc_decode($xmlrpc_val);
Returns a PHP variable or array stuffed with the values found in the xmlrpcval $xmlrpc_val, translated into native PHP types.
> -----Messaggio originale-----
> Da: phpxmlrpc-bounces at usefulinc.com
> [mailto:phpxmlrpc-bounces at usefulinc.com]Per conto di Obantec Support
> Inviato: venerdì 19 dicembre 2003 17:09
> A: phpxmlrpc at usefulinc.com
> Oggetto: Re: [phpxmlrpc] getting results from server ok but!
>
>
> Hi Jeff
>
> thanks for info, i am making progress.
>
> I think the structmem variety.
>
> first script http://www.mds.me.uk/xml-whois.php
>
> does call and simply uses print_r(get_object_vars($result));
> to display
> $result.
>
> second script http://www.mds.me.uk/xml-whois-1.php
>
> uses
>
> $Val = $result->value();
> $domain = $Val->structmem("domain");
> $error = $Val->structmem("error");
> $found = $Val->structmem("found");
>
> and again print_r(get_object_vars($error) etc. with a couple of added
> markers to break up text.
>
> now all i need to do is decode the 3 objects so i can grab
> the items like
> 'address' etc.
> i guess these are nested Array's, any pointers
>
> Mark
>
> ----- Original Message -----
> From: "Jeff Barr" <jeff at vertexdev.com>
> To: "Obantec Support" <support at obantec.net>
> Cc: <phpxmlrpc at usefulinc.com>
> Sent: Friday, December 19, 2003 2:13 PM
> Subject: Re: [phpxmlrpc] getting results from server ok but!
>
>
> > Obantec Support wrote:
> >
> > > i have put together a php script to access a whois server
> that uses xml.
> > > now i used their guides to send correct format of message
> but am lost as
> to
> > > how to use the response.
> >
> > You need to take the results apart using functions such as value,
> > scalarval, and structmem. If your function returned a single
> > value you would do something like this:
> >
> > $Val = $result->value();
> > $ScalarVal = $Val->scalarval();
> >
> > If it returned a structure with name and age members:
> >
> > $Val = $result->value();
> > $NameVal = $Val->structmem("name");
> > $AgeVal = $Val->structmem("age");
> > $Name = $NameVal->scalarval();
> > $Age = $AgeVal->scalarval();
> >
> > Make sense?
> >
> > Jeff;
> >
> > >
> > > is there some function that parses the xml so i can
> access results.
> > > currently i am dumping to screen using
> > >
> > > $result = $client->send($message);// send request
> > >
> > > // error handler in here
> > >
> > > print_r(get_object_vars($result)); // show result to screen
> > >
> > > (i am new to both php and xml but have programmed in perl).
> > >
> > > Sorry if question is a bit OT, i was going to ask how to
> get results
> from
> > > server but googled my way thru my problems.
> > >
> > > Mark
> > >
> > >
> > > _______________________________________________
> > > phpxmlrpc mailing list
> > > phpxmlrpc at usefulinc.com
> > > http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
> >
> >
>
>
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc at usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
More information about the phpxmlrpc
mailing list