Welcome Guest, Not a member yet? Register   Sign In
XML-RPC or just XML or just...
#1

[eluser]jentree[/eluser]
This is the first time I have worked with CI & xml. I am positive I am making things way over complicated.

I found the XML-RPC library, but - how do I know if the API I am trying to talk to is an XML-RPC friendly server? What if it's not?

I need to generate this type of xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Request>
<Node>Hello World</Node>
</Request>


Easy enough I thought, so I gave this a try:
Code:
$this->xmlrpc->set_debug(TRUE);
$this->xmlrpc->server('https://myserver.com/api');
$this->xmlrpc->method('MyMethod');
$request = array('Node', 'Hello World');
  
$this->xmlrpc->request($request);

if ( ! $this->xmlrpc->send_request() )
{
    echo $this->xmlrpc->display_error();
}

I usually get back something like "Did not receive a
Code:
'200 OK' response from remote server."
Or, if I tinker with what I am sending as a request I'll get
Code:
"---Invalid Return--- Top level XML-RPC element is missing---Invalid Return--"
I feel like I'm so close. Can anyone help with a little shove in the right direction?
Thank you!
#2

[eluser]Phil Sturgeon[/eluser]
That looks like plain old XML and not XML-RPC which old and rarely used. Google for my REST Controller, you'll find it much nicer to work with.




Theme © iAndrew 2016 - Forum software by © MyBB