Zend_Soap_Server not working on a production environment

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Zend_Soap_Server not working on a production environment

Guillaume ORIOL
Hi, I am facing an issue while writing a simple SOAP server with ZF. When I execute a method of the web service (getData) on a testing server, everything works perfectly. But when I try to run it on my production environment, I get an Apache server error (HTTP 500): the PHP script times out while trying to execute :
$server = new SoapServer($this->_wsdl, $options);
in Zend_Soap_Server::_getSoap().

If I request the WSDL, the server sends it back properly on BOTH environments.
I enabled the SOAP server on PHP the same way on testing and production environments (both Linux Debian 1.6.x):
extension=php_soap.so
[soap]
soap.wsdl_cache_enabled=0
Any idea? Here is the controller action:
	public function importAction()
	{
        $this->_helper->ViewRenderer->setNoRender();
        $this->_helper->layout->disableLayout();

        $uri = 'http://' . $_SERVER['HTTP_HOST'] . '/shipment/import?wsdl';
    	if (isset($_GET['wsdl'])) {
        	$wsdl = new Zend_Soap_AutoDiscover();
        	// The default URI is set to
        	// 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']
        	// which is exactly what we want. No need to specify it.
        	$wsdl->setClass('ShipmentSynchronization');
        	$wsdl->handle();
        } else {
            $server = new Zend_Soap_Server($uri, array('soap_version' => SOAP_1_2));
            $server->setClass('ShipmentSynchronization');
            $server->handle();
        }
    }
And here is the service class skeleton:
class ShipmentSynchronization
{
    /**
     * Send a flat table resulting of an inner join between...
     * @return string The shipments, containers and references.
     */
    public function getData()
    {
        // ...
    }
    /**
     * Transfer data from temporary table into history table after...
     * @param string $data
     * @return boolean Dummy value without which WinDev is unable to build its SOAP client
     */
    public function acknowledgeData($data)
    {
        // ...
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

Benjamin Eberlei-2
what do you mean by timeout? 30 secs execution? is it maybe that your
production data is so much more huge, that your code is running into problems?
what is the actual bottleneck in the timeouting operation?

greetings,
benjamin

On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:

> Hi,
>
> I am facing an issue while writing a simple SOAP server with ZF.
>
> When I execute a method of the web service (getData) on a testing server,
> everything works perfectly.
> But when I try to run it on my production environment, I get an Apache
> server error (HTTP 500): the PHP script times out while trying to execute :
> $server = new SoapServer($this->_wsdl, $options);
>  in Zend_Soap_Server::_getSoap().
>
> If I request the WSDL, the server sends it back properly on BOTH
> environments.
>
>
> I enabled the SOAP server on PHP the same way on testing and production
> environments (both Linux Debian 1.6.x):
>
> extension=php_soap.so
> [soap]
> soap.wsdl_cache_enabled=0
>
> Any idea?
>
> Here is the controller action:
>
> public function importAction()
> {
>         $this->_helper->ViewRenderer->setNoRender();
>         $this->_helper->layout->disableLayout();
>
>         $uri = 'http://' . $_SERVER['HTTP_HOST'] . '/shipment/import?wsdl';
>     if (isset($_GET['wsdl'])) {
>         $wsdl = new Zend_Soap_AutoDiscover();
>         // The default URI is set to
>         // 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']
>         // which is exactly what we want. No need to specify it.
>         $wsdl->setClass('ShipmentSynchronization');
>         $wsdl->handle();
>         } else {
>             $server = new Zend_Soap_Server($uri, array('soap_version' =>
> SOAP_1_2));
>             $server->setClass('ShipmentSynchronization');
>             $server->handle();
>         }
>     }
>
>
> And here is the service class skeleton:
>
> class ShipmentSynchronization
> {
>     /**
>      * Send a flat table resulting of an inner join between...
>      * @return string The shipments, containers and references.
>      */
>     public function getData()
>     {
>         // ...
>     }
>     /**
>      * Transfer data from temporary table into history table after...
>      * @param string $data
>      * @return boolean Dummy value without which WinDev is unable to build
> its SOAP client
>      */
>     public function acknowledgeData($data)
>     {
>         // ...
>     }
> }
>
>
> -----
> Guillaume ORIOL
> Sofware architect
> Technema

--
Benjamin Eberlei
http://www.beberlei.de
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

Guillaume ORIOL
thank you for your answer Benjamin,

Production data is very light actually (less than 100 rows in a table).
It seems there is no bottleneck in that production environment.
The program runs normally until it raises the new SoapServer() instruction. Then, I don't know exactly what happens because I can not trace inside this PHP class. It looks like PHP tries to instantiate SoapServer class but can't do it and tries it repeatedly. Or may be it is waiting for something. I don't know. What I know is the following operations (in the _getSoap() function) never get executed. Then, probably Apache sends an error after a timeout (about 30s to 1 min).

Any clue?

beberlei wrote
what do you mean by timeout? 30 secs execution? is it maybe that your
production data is so much more huge, that your code is running into problems?
what is the actual bottleneck in the timeouting operation?

greetings,
benjamin

On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:
> Hi,
>
> I am facing an issue while writing a simple SOAP server with ZF.
>
> When I execute a method of the web service (getData) on a testing server,
> everything works perfectly.
> But when I try to run it on my production environment, I get an Apache
> server error (HTTP 500): the PHP script times out while trying to execute :
> $server = new SoapServer($this->_wsdl, $options);
>  in Zend_Soap_Server::_getSoap().
>
> If I request the WSDL, the server sends it back properly on BOTH
> environments.
>
>
> I enabled the SOAP server on PHP the same way on testing and production
> environments (both Linux Debian 1.6.x):
>
> extension=php_soap.so
> [soap]
> soap.wsdl_cache_enabled=0
>
> Any idea?
>
> Here is the controller action:
>
> public function importAction()
> {
>         $this->_helper->ViewRenderer->setNoRender();
>         $this->_helper->layout->disableLayout();
>
>         $uri = 'http://' . $_SERVER['HTTP_HOST'] . '/shipment/import?wsdl';
>     if (isset($_GET['wsdl'])) {
>         $wsdl = new Zend_Soap_AutoDiscover();
>         // The default URI is set to
>         // 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']
>         // which is exactly what we want. No need to specify it.
>         $wsdl->setClass('ShipmentSynchronization');
>         $wsdl->handle();
>         } else {
>             $server = new Zend_Soap_Server($uri, array('soap_version' =>
> SOAP_1_2));
>             $server->setClass('ShipmentSynchronization');
>             $server->handle();
>         }
>     }
>
>
> And here is the service class skeleton:
>
> class ShipmentSynchronization
> {
>     /**
>      * Send a flat table resulting of an inner join between...
>      * @return string The shipments, containers and references.
>      */
>     public function getData()
>     {
>         // ...
>     }
>     /**
>      * Transfer data from temporary table into history table after...
>      * @param string $data
>      * @return boolean Dummy value without which WinDev is unable to build
> its SOAP client
>      */
>     public function acknowledgeData($data)
>     {
>         // ...
>     }
> }
>
>
> -----
> Guillaume ORIOL
> Sofware architect
> Technema

--
Benjamin Eberlei
http://www.beberlei.de
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

weierophinney
Administrator
-- Guillaume Oriol <[hidden email]> wrote
(on Tuesday, 24 February 2009, 10:01 AM -0800):

>
> thank you for your answer Benjamin,
>
> Production data is very light actually (less than 100 rows in a table).
> It seems there is no bottleneck in that production environment.
> The program runs normally until it raises the new SoapServer() instruction.
> Then, I don't know exactly what happens because I can not trace inside this
> PHP class. It looks like PHP tries to instantiate SoapServer class but can't
> do it and tries it repeatedly. Or may be it is waiting for something. I
> don't know. What I know is the following operations (in the _getSoap()
> function) never get executed. Then, probably Apache sends an error after a
> timeout (about 30s to 1 min).
>
> Any clue?

Just a stab in the dark... is soap support enabled in PHP on your
production server?


> beberlei wrote:
> >
> > what do you mean by timeout? 30 secs execution? is it maybe that your
> > production data is so much more huge, that your code is running into
> > problems?
> > what is the actual bottleneck in the timeouting operation?
> >
> > greetings,
> > benjamin
> >
> > On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:
> >> Hi,
> >>
> >> I am facing an issue while writing a simple SOAP server with ZF.
> >>
> >> When I execute a method of the web service (getData) on a testing server,
> >> everything works perfectly.
> >> But when I try to run it on my production environment, I get an Apache
> >> server error (HTTP 500): the PHP script times out while trying to execute
> >> :
> >> $server = new SoapServer($this->_wsdl, $options);
> >>  in Zend_Soap_Server::_getSoap().
> >>
> >> If I request the WSDL, the server sends it back properly on BOTH
> >> environments.
> >>
> >>
> >> I enabled the SOAP server on PHP the same way on testing and production
> >> environments (both Linux Debian 1.6.x):
> >>
> >> extension=php_soap.so
> >> [soap]
> >> soap.wsdl_cache_enabled=0
> >>
> >> Any idea?
> >>
> >> Here is the controller action:
> >>
> >> public function importAction()
> >> {
> >>         $this->_helper->ViewRenderer->setNoRender();
> >>         $this->_helper->layout->disableLayout();
> >>
> >>         $uri = 'http://' . $_SERVER['HTTP_HOST'] .
> >> '/shipment/import?wsdl';
> >>     if (isset($_GET['wsdl'])) {
> >>         $wsdl = new Zend_Soap_AutoDiscover();
> >>         // The default URI is set to
> >>         // 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']
> >>         // which is exactly what we want. No need to specify it.
> >>         $wsdl->setClass('ShipmentSynchronization');
> >>         $wsdl->handle();
> >>         } else {
> >>             $server = new Zend_Soap_Server($uri, array('soap_version' =>
> >> SOAP_1_2));
> >>             $server->setClass('ShipmentSynchronization');
> >>             $server->handle();
> >>         }
> >>     }
> >>
> >>
> >> And here is the service class skeleton:
> >>
> >> class ShipmentSynchronization
> >> {
> >>     /**
> >>      * Send a flat table resulting of an inner join between...
> >>      * @return string The shipments, containers and references.
> >>      */
> >>     public function getData()
> >>     {
> >>         // ...
> >>     }
> >>     /**
> >>      * Transfer data from temporary table into history table after...
> >>      * @param string $data
> >>      * @return boolean Dummy value without which WinDev is unable to
> >> build
> >> its SOAP client
> >>      */
> >>     public function acknowledgeData($data)
> >>     {
> >>         // ...
> >>     }
> >> }
> >>
> >>
> >> -----
> >> Guillaume ORIOL
> >> Sofware architect
> >> Technema
> >
> > --
> > Benjamin Eberlei
> > http://www.beberlei.de
> >
> >
>
>
> -----
> Guillaume ORIOL
> Sofware architect
> Technema
> --
> View this message in context: http://www.nabble.com/Zend_Soap_Server-not-working-on-a-production-environment-tp22183813p22186993.html
> Sent from the Zend Web Services mailing list archive at Nabble.com.
>

--
Matthew Weier O'Phinney
Software Architect       | [hidden email]
Zend Framework           | http://framework.zend.com/
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

Benjamin Eberlei-2
must be, Zend_Soap_Server checks for the extension in the constructor and
throws an exception if not enabled.

i am a bit in the dark here, its an error i havent seen anywhere before.

On Tuesday 24 February 2009 19:36:08 Matthew Weier O'Phinney wrote:

> -- Guillaume Oriol <[hidden email]> wrote
>
> (on Tuesday, 24 February 2009, 10:01 AM -0800):
> > thank you for your answer Benjamin,
> >
> > Production data is very light actually (less than 100 rows in a table).
> > It seems there is no bottleneck in that production environment.
> > The program runs normally until it raises the new SoapServer()
> > instruction. Then, I don't know exactly what happens because I can not
> > trace inside this PHP class. It looks like PHP tries to instantiate
> > SoapServer class but can't do it and tries it repeatedly. Or may be it is
> > waiting for something. I don't know. What I know is the following
> > operations (in the _getSoap() function) never get executed. Then,
> > probably Apache sends an error after a timeout (about 30s to 1 min).
> >
> > Any clue?
>
> Just a stab in the dark... is soap support enabled in PHP on your
> production server?
>
> > beberlei wrote:
> > > what do you mean by timeout? 30 secs execution? is it maybe that your
> > > production data is so much more huge, that your code is running into
> > > problems?
> > > what is the actual bottleneck in the timeouting operation?
> > >
> > > greetings,
> > > benjamin
> > >
> > > On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:
> > >> Hi,
> > >>
> > >> I am facing an issue while writing a simple SOAP server with ZF.
> > >>
> > >> When I execute a method of the web service (getData) on a testing
> > >> server, everything works perfectly.
> > >> But when I try to run it on my production environment, I get an Apache
> > >> server error (HTTP 500): the PHP script times out while trying to
> > >> execute
> > >>
> > >> $server = new SoapServer($this->_wsdl, $options);
> > >>  in Zend_Soap_Server::_getSoap().
> > >>
> > >> If I request the WSDL, the server sends it back properly on BOTH
> > >> environments.
> > >>
> > >>
> > >> I enabled the SOAP server on PHP the same way on testing and
> > >> production environments (both Linux Debian 1.6.x):
> > >>
> > >> extension=php_soap.so
> > >> [soap]
> > >> soap.wsdl_cache_enabled=0
> > >>
> > >> Any idea?
> > >>
> > >> Here is the controller action:
> > >>
> > >> public function importAction()
> > >> {
> > >>         $this->_helper->ViewRenderer->setNoRender();
> > >>         $this->_helper->layout->disableLayout();
> > >>
> > >>         $uri = 'http://' . $_SERVER['HTTP_HOST'] .
> > >> '/shipment/import?wsdl';
> > >>     if (isset($_GET['wsdl'])) {
> > >>         $wsdl = new Zend_Soap_AutoDiscover();
> > >>         // The default URI is set to
> > >>         // 'http://' . $_SERVER['HTTP_HOST'] .
> > >> $_SERVER['SCRIPT_NAME'] // which is exactly what we want. No need to
> > >> specify it. $wsdl->setClass('ShipmentSynchronization');
> > >>         $wsdl->handle();
> > >>         } else {
> > >>             $server = new Zend_Soap_Server($uri, array('soap_version'
> > >> => SOAP_1_2));
> > >>             $server->setClass('ShipmentSynchronization');
> > >>             $server->handle();
> > >>         }
> > >>     }
> > >>
> > >>
> > >> And here is the service class skeleton:
> > >>
> > >> class ShipmentSynchronization
> > >> {
> > >>     /**
> > >>      * Send a flat table resulting of an inner join between...
> > >>      * @return string The shipments, containers and references.
> > >>      */
> > >>     public function getData()
> > >>     {
> > >>         // ...
> > >>     }
> > >>     /**
> > >>      * Transfer data from temporary table into history table after...
> > >>      * @param string $data
> > >>      * @return boolean Dummy value without which WinDev is unable to
> > >> build
> > >> its SOAP client
> > >>      */
> > >>     public function acknowledgeData($data)
> > >>     {
> > >>         // ...
> > >>     }
> > >> }
> > >>
> > >>
> > >> -----
> > >> Guillaume ORIOL
> > >> Sofware architect
> > >> Technema
> > >
> > > --
> > > Benjamin Eberlei
> > > http://www.beberlei.de
> >
> > -----
> > Guillaume ORIOL
> > Sofware architect
> > Technema
> > --
> > View this message in context:
> > http://www.nabble.com/Zend_Soap_Server-not-working-on-a-production-enviro
> >nment-tp22183813p22186993.html Sent from the Zend Web Services mailing
> > list archive at Nabble.com.

--
Benjamin Eberlei
http://www.beberlei.de
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

Guillaume ORIOL
In reply to this post by weierophinney
Hy Matthew,

I have added that line to my php.ini (Linux server):
extension=php_soap.so

and phpinfo() says:
soap
Soap Client enabled
Soap Server enabled

Directive Local Value Master Value
soap.wsdl_cache 1 1
soap.wsdl_cache_dir /tmp /tmp
soap.wsdl_cache_enabled 0 0
soap.wsdl_cache_limit 5 5
soap.wsdl_cache_ttl 86400 86400

Thanks in advance
--
Guillaume

Matthew Weier O'Phinney-3 wrote
-- Guillaume Oriol <goriol@technema.fr> wrote
(on Tuesday, 24 February 2009, 10:01 AM -0800):
>
> thank you for your answer Benjamin,
>
> Production data is very light actually (less than 100 rows in a table).
> It seems there is no bottleneck in that production environment.
> The program runs normally until it raises the new SoapServer() instruction.
> Then, I don't know exactly what happens because I can not trace inside this
> PHP class. It looks like PHP tries to instantiate SoapServer class but can't
> do it and tries it repeatedly. Or may be it is waiting for something. I
> don't know. What I know is the following operations (in the _getSoap()
> function) never get executed. Then, probably Apache sends an error after a
> timeout (about 30s to 1 min).
>
> Any clue?

Just a stab in the dark... is soap support enabled in PHP on your
production server?


> beberlei wrote:
> >
> > what do you mean by timeout? 30 secs execution? is it maybe that your
> > production data is so much more huge, that your code is running into
> > problems?
> > what is the actual bottleneck in the timeouting operation?
> >
> > greetings,
> > benjamin
> >
> > On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:
> >> Hi,
> >>
> >> I am facing an issue while writing a simple SOAP server with ZF.
> >>
> >> When I execute a method of the web service (getData) on a testing server,
> >> everything works perfectly.
> >> But when I try to run it on my production environment, I get an Apache
> >> server error (HTTP 500): the PHP script times out while trying to execute
> >> :
> >> $server = new SoapServer($this->_wsdl, $options);
> >>  in Zend_Soap_Server::_getSoap().
> >>
> >> If I request the WSDL, the server sends it back properly on BOTH
> >> environments.
> >>
> >>
> >> I enabled the SOAP server on PHP the same way on testing and production
> >> environments (both Linux Debian 1.6.x):
> >>
> >> extension=php_soap.so
> >> [soap]
> >> soap.wsdl_cache_enabled=0
> >>
> >> Any idea?
> >>
> >> Here is the controller action:
> >>
> >> public function importAction()
> >> {
> >>         $this->_helper->ViewRenderer->setNoRender();
> >>         $this->_helper->layout->disableLayout();
> >>
> >>         $uri = 'http://' . $_SERVER['HTTP_HOST'] .
> >> '/shipment/import?wsdl';
> >>     if (isset($_GET['wsdl'])) {
> >>         $wsdl = new Zend_Soap_AutoDiscover();
> >>         // The default URI is set to
> >>         // 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']
> >>         // which is exactly what we want. No need to specify it.
> >>         $wsdl->setClass('ShipmentSynchronization');
> >>         $wsdl->handle();
> >>         } else {
> >>             $server = new Zend_Soap_Server($uri, array('soap_version' =>
> >> SOAP_1_2));
> >>             $server->setClass('ShipmentSynchronization');
> >>             $server->handle();
> >>         }
> >>     }
> >>
> >>
> >> And here is the service class skeleton:
> >>
> >> class ShipmentSynchronization
> >> {
> >>     /**
> >>      * Send a flat table resulting of an inner join between...
> >>      * @return string The shipments, containers and references.
> >>      */
> >>     public function getData()
> >>     {
> >>         // ...
> >>     }
> >>     /**
> >>      * Transfer data from temporary table into history table after...
> >>      * @param string $data
> >>      * @return boolean Dummy value without which WinDev is unable to
> >> build
> >> its SOAP client
> >>      */
> >>     public function acknowledgeData($data)
> >>     {
> >>         // ...
> >>     }
> >> }
> >>
> >>
> >> -----
> >> Guillaume ORIOL
> >> Sofware architect
> >> Technema
> >
> > --
> > Benjamin Eberlei
> > http://www.beberlei.de
> >
> >
>
>
> -----
> Guillaume ORIOL
> Sofware architect
> Technema
> --
> View this message in context: http://www.nabble.com/Zend_Soap_Server-not-working-on-a-production-environment-tp22183813p22186993.html
> Sent from the Zend Web Services mailing list archive at Nabble.com.
>

--
Matthew Weier O'Phinney
Software Architect       | matthew@zend.com
Zend Framework           | http://framework.zend.com/
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

Guillaume ORIOL
In reply to this post by Benjamin Eberlei-2
On the production environment, the web service client is on a LAN and accesses the internet through a proxy. Could it be a possible explanation? I am not sure, as I see the request coming into the PHP application.

Do you see something else?

beberlei wrote
must be, Zend_Soap_Server checks for the extension in the constructor and
throws an exception if not enabled.

i am a bit in the dark here, its an error i havent seen anywhere before.

On Tuesday 24 February 2009 19:36:08 Matthew Weier O'Phinney wrote:
> -- Guillaume Oriol <goriol@technema.fr> wrote
>
> (on Tuesday, 24 February 2009, 10:01 AM -0800):
> > thank you for your answer Benjamin,
> >
> > Production data is very light actually (less than 100 rows in a table).
> > It seems there is no bottleneck in that production environment.
> > The program runs normally until it raises the new SoapServer()
> > instruction. Then, I don't know exactly what happens because I can not
> > trace inside this PHP class. It looks like PHP tries to instantiate
> > SoapServer class but can't do it and tries it repeatedly. Or may be it is
> > waiting for something. I don't know. What I know is the following
> > operations (in the _getSoap() function) never get executed. Then,
> > probably Apache sends an error after a timeout (about 30s to 1 min).
> >
> > Any clue?
>
> Just a stab in the dark... is soap support enabled in PHP on your
> production server?
>
> > beberlei wrote:
> > > what do you mean by timeout? 30 secs execution? is it maybe that your
> > > production data is so much more huge, that your code is running into
> > > problems?
> > > what is the actual bottleneck in the timeouting operation?
> > >
> > > greetings,
> > > benjamin
> > >
> > > On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:
> > >> Hi,
> > >>
> > >> I am facing an issue while writing a simple SOAP server with ZF.
> > >>
> > >> When I execute a method of the web service (getData) on a testing
> > >> server, everything works perfectly.
> > >> But when I try to run it on my production environment, I get an Apache
> > >> server error (HTTP 500): the PHP script times out while trying to
> > >> execute
> > >>
> > >> $server = new SoapServer($this->_wsdl, $options);
> > >>  in Zend_Soap_Server::_getSoap().
> > >>
> > >> If I request the WSDL, the server sends it back properly on BOTH
> > >> environments.
> > >>
> > >>
> > >> I enabled the SOAP server on PHP the same way on testing and
> > >> production environments (both Linux Debian 1.6.x):
> > >>
> > >> extension=php_soap.so
> > >> [soap]
> > >> soap.wsdl_cache_enabled=0
> > >>
> > >> Any idea?
> > >>
> > >> Here is the controller action:
> > >>
> > >> public function importAction()
> > >> {
> > >>         $this->_helper->ViewRenderer->setNoRender();
> > >>         $this->_helper->layout->disableLayout();
> > >>
> > >>         $uri = 'http://' . $_SERVER['HTTP_HOST'] .
> > >> '/shipment/import?wsdl';
> > >>     if (isset($_GET['wsdl'])) {
> > >>         $wsdl = new Zend_Soap_AutoDiscover();
> > >>         // The default URI is set to
> > >>         // 'http://' . $_SERVER['HTTP_HOST'] .
> > >> $_SERVER['SCRIPT_NAME'] // which is exactly what we want. No need to
> > >> specify it. $wsdl->setClass('ShipmentSynchronization');
> > >>         $wsdl->handle();
> > >>         } else {
> > >>             $server = new Zend_Soap_Server($uri, array('soap_version'
> > >> => SOAP_1_2));
> > >>             $server->setClass('ShipmentSynchronization');
> > >>             $server->handle();
> > >>         }
> > >>     }
> > >>
> > >>
> > >> And here is the service class skeleton:
> > >>
> > >> class ShipmentSynchronization
> > >> {
> > >>     /**
> > >>      * Send a flat table resulting of an inner join between...
> > >>      * @return string The shipments, containers and references.
> > >>      */
> > >>     public function getData()
> > >>     {
> > >>         // ...
> > >>     }
> > >>     /**
> > >>      * Transfer data from temporary table into history table after...
> > >>      * @param string $data
> > >>      * @return boolean Dummy value without which WinDev is unable to
> > >> build
> > >> its SOAP client
> > >>      */
> > >>     public function acknowledgeData($data)
> > >>     {
> > >>         // ...
> > >>     }
> > >> }
> > >>
> > >>
> > >> -----
> > >> Guillaume ORIOL
> > >> Sofware architect
> > >> Technema
> > >
> > > --
> > > Benjamin Eberlei
> > > http://www.beberlei.de
> >
> > -----
> > Guillaume ORIOL
> > Sofware architect
> > Technema
> > --
> > View this message in context:
> > http://www.nabble.com/Zend_Soap_Server-not-working-on-a-production-enviro
> >nment-tp22183813p22186993.html Sent from the Zend Web Services mailing
> > list archive at Nabble.com.

--
Benjamin Eberlei
http://www.beberlei.de
Reply | Threaded
Open this post in threaded view
|

Re: Zend_Soap_Server not working on a production environment

Guillaume ORIOL
The problem was related to the firewall on the server hosting the web service.
They were too restrictive for the SoapServer to instantiate properly.
After their modification, the web service was operating normally.

Thank you for your help.

Guillaume Oriol wrote
On the production environment, the web service client is on a LAN and accesses the internet through a proxy. Could it be a possible explanation? I am not sure, as I see the request coming into the PHP application.

Do you see something else?

beberlei wrote
must be, Zend_Soap_Server checks for the extension in the constructor and
throws an exception if not enabled.

i am a bit in the dark here, its an error i havent seen anywhere before.

On Tuesday 24 February 2009 19:36:08 Matthew Weier O'Phinney wrote:
> -- Guillaume Oriol <goriol@technema.fr> wrote
>
> (on Tuesday, 24 February 2009, 10:01 AM -0800):
> > thank you for your answer Benjamin,
> >
> > Production data is very light actually (less than 100 rows in a table).
> > It seems there is no bottleneck in that production environment.
> > The program runs normally until it raises the new SoapServer()
> > instruction. Then, I don't know exactly what happens because I can not
> > trace inside this PHP class. It looks like PHP tries to instantiate
> > SoapServer class but can't do it and tries it repeatedly. Or may be it is
> > waiting for something. I don't know. What I know is the following
> > operations (in the _getSoap() function) never get executed. Then,
> > probably Apache sends an error after a timeout (about 30s to 1 min).
> >
> > Any clue?
>
> Just a stab in the dark... is soap support enabled in PHP on your
> production server?
>
> > beberlei wrote:
> > > what do you mean by timeout? 30 secs execution? is it maybe that your
> > > production data is so much more huge, that your code is running into
> > > problems?
> > > what is the actual bottleneck in the timeouting operation?
> > >
> > > greetings,
> > > benjamin
> > >
> > > On Tuesday 24 February 2009 17:40:42 Guillaume Oriol wrote:
> > >> Hi,
> > >>
> > >> I am facing an issue while writing a simple SOAP server with ZF.
> > >>
> > >> When I execute a method of the web service (getData) on a testing
> > >> server, everything works perfectly.
> > >> But when I try to run it on my production environment, I get an Apache
> > >> server error (HTTP 500): the PHP script times out while trying to
> > >> execute
> > >>
> > >> $server = new SoapServer($this->_wsdl, $options);
> > >>  in Zend_Soap_Server::_getSoap().
> > >>
> > >> If I request the WSDL, the server sends it back properly on BOTH
> > >> environments.
> > >>
> > >>
> > >> I enabled the SOAP server on PHP the same way on testing and
> > >> production environments (both Linux Debian 1.6.x):
> > >>
> > >> extension=php_soap.so
> > >> [soap]
> > >> soap.wsdl_cache_enabled=0
> > >>
> > >> Any idea?
> > >>
> > >> Here is the controller action:
> > >>
> > >> public function importAction()
> > >> {
> > >>         $this->_helper->ViewRenderer->setNoRender();
> > >>         $this->_helper->layout->disableLayout();
> > >>
> > >>         $uri = 'http://' . $_SERVER['HTTP_HOST'] .
> > >> '/shipment/import?wsdl';
> > >>     if (isset($_GET['wsdl'])) {
> > >>         $wsdl = new Zend_Soap_AutoDiscover();
> > >>         // The default URI is set to
> > >>         // 'http://' . $_SERVER['HTTP_HOST'] .
> > >> $_SERVER['SCRIPT_NAME'] // which is exactly what we want. No need to
> > >> specify it. $wsdl->setClass('ShipmentSynchronization');
> > >>         $wsdl->handle();
> > >>         } else {
> > >>             $server = new Zend_Soap_Server($uri, array('soap_version'
> > >> => SOAP_1_2));
> > >>             $server->setClass('ShipmentSynchronization');
> > >>             $server->handle();
> > >>         }
> > >>     }
> > >>
> > >>
> > >> And here is the service class skeleton:
> > >>
> > >> class ShipmentSynchronization
> > >> {
> > >>     /**
> > >>      * Send a flat table resulting of an inner join between...
> > >>      * @return string The shipments, containers and references.
> > >>      */
> > >>     public function getData()
> > >>     {
> > >>         // ...
> > >>     }
> > >>     /**
> > >>      * Transfer data from temporary table into history table after...
> > >>      * @param string $data
> > >>      * @return boolean Dummy value without which WinDev is unable to
> > >> build
> > >> its SOAP client
> > >>      */
> > >>     public function acknowledgeData($data)
> > >>     {
> > >>         // ...
> > >>     }
> > >> }
> > >>
> > >>
> > >> -----
> > >> Guillaume ORIOL
> > >> Sofware architect
> > >> Technema
> > >
> > > --
> > > Benjamin Eberlei
> > > http://www.beberlei.de
> >
> > -----
> > Guillaume ORIOL
> > Sofware architect
> > Technema
> > --
> > View this message in context:
> > http://www.nabble.com/Zend_Soap_Server-not-working-on-a-production-enviro
> >nment-tp22183813p22186993.html Sent from the Zend Web Services mailing
> > list archive at Nabble.com.

--
Benjamin Eberlei
http://www.beberlei.de