Soap Server does not uses getLastRequest

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

Soap Server does not uses getLastRequest

pal4life
Hi,
http://framework.zend.com/manual/1.11/en/zend.soap.server.html

The above link shows an example of logging requests on the SOAP server using the getLastRequest. I am aware of using it with the client but is there a way to log those request with the server?

 $this->getHelper('viewRenderer')->setNoRender(true);
     
          // initialize server and set WSDL file location
      $server = new Zend_Soap_Server('wsdl location');

     
      // set SOAP service class      
      $server->setClass('Webservices_Manager');
       
                $server->setRequest();
               
               
      // register exceptions that generate SOAP faults
      $server->registerFaultException(array('Webservices_Exception'));
     
      // handle request
      $server->handle();
               
        echo $request = $server->getLastRequest();

Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Soap Server does not uses getLastRequest

RQuadling
On 2 November 2010 21:01, pal4life <[hidden email]> wrote:

>
> Hi,
> http://framework.zend.com/manual/1.11/en/zend.soap.server.html
>
> The above link shows an example of logging requests on the SOAP server using
> the getLastRequest. I am aware of using it with the client but is there a
> way to log those request with the server?
>
>  $this->getHelper('viewRenderer')->setNoRender(true);
>
>          // initialize server and set WSDL file location
>      $server = new Zend_Soap_Server('wsdl location');
>
>      // initialize server and set URI
>      //$server = new Zend_Soap_Server(null,
>  //       array('uri' => 'http://webservices.tjh2b.com/Labrequest/soap'));
>
>      // set SOAP service class
>      $server->setClass('Webservices_Manager');
>
>                $server->setRequest();
>
>
>      // register exceptions that generate SOAP faults
>      $server->registerFaultException(array('Webservices_Exception'));
>
>      // handle request
>      $server->handle();
>
>        echo $request = $server->getLastRequest();
>
> Thank you.
>
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/Soap-Server-does-not-uses-getLastRequest-tp3024416p3024416.html
> Sent from the Zend Web Services mailing list archive at Nabble.com.
>

I would create a subclass to Zend_Soap_Server and override _setRequest ...

class myZSS extends Zend_Soap_Server {
    /**
     * Set and log the request.
     *
     * $request may be any of:
     * - DOMDocument; if so, then cast to XML
     * - DOMNode; if so, then grab owner document and cast to XML
     * - SimpleXMLElement; if so, then cast to XML
     * - stdClass; if so, calls __toString() and verifies XML
     * - string; if so, verifies XML
     *
     * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request
     * @return Zend_Soap_Server
     */
    protected function _setRequest($request) {
        // Set the request.
        parent::_setRequest($request);

        // Log the request.
        // $this->_getRequest() is the call to make to get the XML.

        // Return the instance to allow for chaining.
        return $this;
    }
}



--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY