I am getting the following error when I do $this->server->register(). Help!
*Notice* (8) <javascript:void(0);>: Undefined index: content-type [*
APP\vendors\nusoap\lib\nusoap.php*, line *4212*]
Code <javascript:void(0);> | Context <javascript:void(0);>
$headers = array(
"accept" => "*/*",
"accept-language" => "en-us",
"ua-cpu" => "x86",
"accept-encoding" => "gzip, deflate",
"user-agent" => "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;
SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506;
.NET CLR 1.1.4322; InfoPath.2)",
"host" => "localhost",
"connection" => "Keep-Alive",
"cookie" => "CAKEPHP=f99548edaf9049aec76cdeb7cbbe9cc5"
)
$data = ""
*/ function parseRequest($headers, $data) {
$this->debug('Entering parseRequest() for data of length ' .
strlen($data) . ' and type ' . $headers['content-type']);
nusoap_server::parseRequest() - APP\vendors\nusoap\lib\nusoap.php, line 4212
nusoap_server::parse_request() - APP\vendors\nusoap\lib\nusoap.php, line 3861
nusoap_server::service() - APP\vendors\nusoap\lib\nusoap.php, line 3687
NusoapComponent::initialize() - APP\controllers\components\nusoap.php, line 31
Component::initialize() - CORE\cake\libs\controller\component.php, line 86
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 227
[main] - APP\webroot\index.php, line 84
On Mon, Sep 8, 2008 at 5:24 AM, Marcelius <[EMAIL PROTECTED]> wrote:
>
> I wasn't really impressed by all the "PHP to wsdl" converters out
> there because I just couldn't create complex datastructures with them.
> So I "manualy" created the wsdl with an eclipse extension:
> http://wiki.eclipse.org/index.php/Introduction_to_the_WSDL_Editor
>
> Zend studio also provides automatic generation of wsdl files but I
> found it a bit buggy (read: crashed alot)
>
> Also remember to disable the soap wsdl cache in PHP :-)
>
> On 8 sep, 12:42, . <[EMAIL PROTECTED]> wrote:
> > Marcelius, how do you generate the wsdl files? do you use jool.nl's wsdl
> > component, or does php's soap extension generate the wsdl files for you?
> > thanks
> >
> > On Mon, Sep 8, 2008 at 2:56 AM, Marcelius <[EMAIL PROTECTED]>
> wrote:
> >
> > > 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
-~----------~----~----~----~------~----~------~--~---