views:

40

answers:

0

I get the following error when setting up an Soap server with Zend Framwork.

SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in 'http://manager.sander.dev.vije.local/butler/service/soap/wsdl/1'

The link from the error seems to return the correct XML:

<definitions name="Espire_Product_Butler_Soap_Server_BusinessManager" targetNamespace="http://manager.sander.dev.vije.local/butler/service/soap/wsdl/1"&gt;
    ....
</definitions>

The controller code:

<?php

class Default_ServiceController extends Zend_Controller_Action
{
 public function soapAction()
 {
     ini_set('soap.wsdl_cache_enabled', '0');

     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();

     $server = new Espire_Product_Butler_Soap_Server_BusinessManager();

     if ($this->_getParam('wsdl')) {
            $autodiscover = new Zend_Soap_AutoDiscover();
            $autodiscover->setClass(get_class($server));
            $autodiscover->handle();
     } else {
         $soap = new Zend_Soap_Server('http://'.$_SERVER['HTTP_HOST'].$this-&gt;view-&gt;url(array('wsdl' => 1)));
         $soap->setClass(get_class($server));
         $soap->handle();
     }
 }
}