xmlrpc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xmlrpc

Synchro-2

(reposting as it didn't appear on the group?)

I'm trying to get my head around how xmlrpc works in cake. This thread:
http://groups-beta.google.com/group/cake-php/browse_thread/thread/a5540ce03706601d/0a2a562c19355360
has a few details, and there are some vague references in the config
section in the manual, but I've not found any working examples as yet.

I have enabled web services in core, I've defined an xmlrpc function in
a controller, stuck a chunk of placeholder text in a view, but it's not
doing anything.

In app/controllers/things_controller.php:

function xmlrpc_doSomething() {
  echo 'hello';
}

In app/views/things/xmlrpc/do_something.thtml:

blah

but when I hit /xmlrpc/things/do_something

I get a 404, and it's looking for xmlrpc.txt.

Have I got the naming wrong? Have I missed something? It doesn't help
that this is my first encounter with xmlrpc...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: xmlrpc

sabkaraja

hi,

since you have created the action xmlrpc_dosomething in things
controller,
the view should in
/app/views/things/xmlrpc_dosomething.thtml

try keep the action casing simple to follow. either use
someThingLikeThis or some_thing_like_this. Dont mix it
something_likeThis. Can be confusing for the computers and humans too
(while bug hunting).

among other things, you may need to use a separate layou for xmlrpc.
$this->layout = 'ajax'; or $this->layout = false;
should do.

Also dont echo outputs from the controller. send the data to your view
using :
$this->set('somedataforview', 'blablabla');

now in your view file, you can echo
<? echo $somedataforview; ?>

before the data is being written to the output, add some headers for
creating the xml output
Header("Content-Type: text/xml");

cheers
-R
On Nov 2, 4:59 pm, "Synchro" <[hidden email]> wrote:

> (reposting as it didn't appear on the group?)
>
> I'm trying to get my head around how xmlrpc works in cake. This thread:http://groups-beta.google.com/group/cake-php/browse_thread/thread/a55...
> has a few details, and there are some vague references in the config
> section in the manual, but I've not found any working examples as yet.
>
> I have enabled web services in core, I've defined an xmlrpc function in
> a controller, stuck a chunk of placeholder text in a view, but it's not
> doing anything.
>
> In app/controllers/things_controller.php:
>
> function xmlrpc_doSomething() {
>   echo 'hello';
>
> }In app/views/things/xmlrpc/do_something.thtml:
>
> blah
>
> but when I hit /xmlrpc/things/do_something
>
> I get a 404, and it's looking for xmlrpc.txt.
>
> Have I got the naming wrong? Have I missed something? It doesn't help
> that this is my first encounter with xmlrpc...


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---