Hi
Don't know the exact problems you have but here's a piece of my soap
implementation. Please note that this is done with php5's sope
extension, not nusoap.
In my site:
domain.com/soapcontroller/wsdl
renderes a wsdl file like so:
public function wsdl(){
$this->ext = ".wsdl";
$this->layout = false;
Configure::write('debug', 0); //else renders debug info
$this->RequestHandler->respondAs('xml');
}
//and the main method that handles any soap request
domain.com/soapcontroller/service
public function service(){
//turn of rendering
$this->layout = false;
$this->autoRender = false;
Configure::write('debug', 0);
$server = $this->getSoapServer(); //return new
SoapServer();
$server->setObject($this); //every soap method is
defined in this
controller
$server->handle();
}
maybe you could check the xml input/output if cake hasn't put any
(debug) html in it.
Also: I used soapUI for debugging, pretty handy :-)
On 8 sep, 10:52, . <[EMAIL PROTECTED]> wrote:
> david, theoretically there is no problem with soap on cakephp. it's just
> that i am having trouble integrating it into cake. any help would be
> appreciated.
>
> On Mon, Sep 8, 2008 at 1:40 AM, . <[EMAIL PROTECTED]> wrote:
> > reference:http://www.oclipa.com/university/nusoap/3.php
>
> > On Mon, Sep 8, 2008 at 1:40 AM, . <[EMAIL PROTECTED]> wrote:
>
> >> I've also been trying to follow this tutorial and integrate with cake,
> >> but without success. All I see is a blank page. Any ideas? Here is my code:
>
> >> <?
> >> class TestController extends AppController
> >> {
> >> var $components=array("RequestHandler");
> >> var $uses=array();
>
> >> function c()
> >> {
> >> Configure::write('debug',0);
> >> $this->autoRender = FALSE;
> >> App::import('Vendor','test',array('file'=>'nusoap/lib/nusoap.php'));
>
> >> // This is location of the remote service
> >> $client = new soapclient('http://localhost/test/server');
>
> >> // Check for any errors from the remote service
> >> $err = $client->getError();
> >> if ($err) {
> >> echo '<p><b>Error: ' . $err . '</b></p>';
> >> }
>
> >> // Call the SOAP method on the remote service
> >> $person = array('firstname' => 'Fred', 'age' => 22);
> >> $result = $client->call(
> >> 'hello', array('message' => new
> >> soapval('id','Person',$person,false,'urn:AnyURN'))
> >> );
>
> >> // Check for any faults reported by the remote service
> >> if ($client->fault) {
> >> echo '<p><b>Fault: ';
> >> print_r($result);
> >> echo '</b></p>';
> >> } else {
> >> // Check for any errors from the remote service
> >> $err = $client->getError();
> >> if ($err) {
> >> echo '<p><b>Error: ' . $err . '</b></p>';
> >> } else {
> >> // If everything is OK display the result
> >> print $result['output_string'] . ' ';
> >> if ( $result['allow'] == 1 ) {
> >> print "You may continue...";
> >> } else {
> >> print "You are too young!";
> >> }
> >> }
> >> }
> >> }
>
> >> function s()
> >> {
> >> Configure::write('debug',0);
> >> $this->autoRender = FALSE;
> >> App::import('Vendor','test',array('file'=>'nusoap/lib/nusoap.php'));
> >> $server = new soap_server;
> >> // This states the method which can be accessed.
> >> $server->register('hello');
> >> // This returns the result
> >> $server->service($HTTP_RAW_POST_DATA);
> >> }
>
> >> // This is the method
> >> function hello($input)
> >> {
> >> $output_string = 'Hello ' . $input['firstname'] .
> >> '. You are ' . $input['age'] . ' years old.';
>
> >> if ($input['age'] >= 18)
> >> {
> >> $allow = 1;
> >> }
>
> >> $output = array(
> >> 'output_string' => $output_string,
> >> 'allow' => $allow
> >> );
>
> >> return new soapval('return', 'HelloInfo', $output, false,
> >> 'urn:AnyURN');
> >> }
>
> >> }
>
> >> ?>
>
> >> On Mon, Sep 8, 2008 at 1:28 AM, David C. Zentgraf <[EMAIL
> >> PROTECTED]>wrote:
>
> >>> What's the problem with SOAP in Cake?
> >>> I'm asking because I'll soon have to pull through a project with a
> >>> tight schedule and I'll be needing SOAP in it.
> >>> And as people like to say a lot here, there's still PHP in CakePHP, so
> >>> I was counting on using the PHP SOAP functions without thinking too
> >>> much. Any problems with them one needs to be aware of?
>
> >>> Chrs,
> >>> Dav
>
> >>> On 8 Sep 2008, at 16:22, . wrote:
>
> >>> > has anyone gotten soap or nusoap to work with cake 1.2?
>
> >>> > I've been trying to follow this tutorial, but haven't gotten it to
> >>> > work yet.
>
> >>>http://bakery.cakephp.org/articles/view/a-component-to-help-creating-...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---