2008年8月24日星期日

Re: [fw-webservices] Building a MVC-based Soap server

Wow, It´s working now!

Thank you very much Wishnu Eka, you saved my day :-)

On Fri, Aug 22, 2008 at 3:22 AM, Wishnu Eka <dying.angel@gmail.com> wrote:

I think i got it right now, it's the wsdl cache that does that. so i overide
the ini with this code :
ini_set("soap.wsdl_cache_enabled", "0");
and it works fine now :)

so this is what i change in the library, thanks to
Matthias  for pointing this out. please be aware that this patch is only a
temporary solution and the library code may change in the future.

Wsdl.php
---------------
in the __construct method

     if ($uri instanceof Zend_Uri_Http) {
          $uri = $uri->getUri();
      }
      $wsdl = "<?xml version='1.0' ?>
              <definitions name='$name' targetNamespace='urn:$name'
                  xmlns='http://schemas.xmlsoap.org/wsdl/'
                  xmlns:tns='$uri'
                  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
                  xmlns:xsd='http://www.w3.org/2001/XMLSchema'

xmlns:soap-enc='http://schemas.xmlsoap.org/soap/encoding/'></definitions>";

AutoDiscover.php
--------------------
in setClass method, i use the $namespace variable because it's been remarked
as "not used", use it as the url for SOAP request.

               if (!empty($namespace)) {
                       $uri = Zend_Uri::factory('http://' . $_SERVER['HTTP_HOST'] . $namespace);
               } else {
                       $uri = Zend_Uri::factory('http://' . $_SERVER['HTTP_HOST'] .
$_SERVER['SCRIPT_NAME']);
               }


~Wishnu

没有评论: