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
http://osdir.com/ml/php.zend.framework.general/2006-10/msg00457.html
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
Wishnu Eka wrote:
>
> Hello there, i'm struggling to build it too :,( and still does'nt succeed.
> maybe i can share a little,
> i've set up the wsdl in this address
> "http://localhost/ZendProjects/WebServices/auth/wsdl",
> the action url in the "http://localhost/ZendProjects/WebServices/auth",
> and the test client in the
> "http://localhost/ZendProjects/WebServices/auth/testclient".
>
> i've tracked my soap request header and it pointed to
> "/ZendProjects/WebServices/index.php"
> first i think it's the wsdl ( created by Zend_Soap_AutoDiscover ) that
> pointed to the wrong uri,
> because the Namespace property is contain
> http://localhost/ZendProjects/WebServices/index.php.
> then i edit the Soap/AutoDiscover.php and Soap/Wsdl.php as pointed by
> http://osdir.com/ml/php.zend.framework.general/2006-10/msg00457.html this
> Post
> the wsdl changed to my url, but what puzzled me is that my request is
> still to "/ZendProjects/WebServices/index.php" ??? i don't know what else
> to do %-|
>
> http://osdir.com/ml/php.zend.framework.general/2006-10/msg00457.html
>
>
> Luiz Vitor wrote:
>>
>> Sorry for bumping this, but I´m still trying to make this work.
>>
>> Didn´t anyone built a soap sever using MVC architeture?
>>
>> On Thu, Aug 14, 2008 at 9:28 AM, Luiz Vitor <prowler666@gmail.com> wrote:
>>
>>> Hi there
>>>
>>> I´m trying to build a soap server using the ZF MVC architeture, but I
>>> can´t
>>> get it to work.
>>>
>>> I have a Service model used as a gateway between the soap server and the
>>> application logic.
>>>
>>> class Services
>>> {
>>> /**
>>> * Verify user credentials
>>> *
>>> * @param string $username
>>> * @param string $password
>>> * @return bool
>>> */
>>> public function authenticate($username, $password)
>>> {
>>> // code to authenticate
>>> }
>>> }
>>>
>>>
>>> On the other part, I have a ServiceController which I setup the wsdl
>>> autodiscover and server
>>>
>>> class ServiceController extends Zend_Controller_Action
>>> {
>>> public function wsdlAction()
>>> {
>>> $wsdl = new Zend_Soap_Wsdl();
>>> $wsdl->setClass('Services');
>>> $wsdl->handle();
>>> exit;
>>> }
>>>
>>>
>>> public function serverAction()
>>> {
>>> $server = new
>>> Zend_Soap_Server('http://myhost.com/service/wsdl/'<http://myhost.com/service/wsdl/%27>
>>> );
>>> $server->setClass('Services');
>>> $server->handle();
>>> exit;
>>> }
>>> }
>>>
>>> Up to now everything works as expected, when I access
>>> http://myhost.com/service/wsdl/ I get the XML describing the Service
>>> class.
>>>
>>> Now comes the problem: I can´t make any requests to the server. Here´s
>>> what
>>> I´m trying:
>>>
>>> $client = new
>>> Zend_Soap_Client('http://myhost.com/service/server'<http://myhost.com/service/server%27>);
>>> // tryied http://myhost.com/service/wsdl/ too with no success
>>> Zend_Debug::dump($client->authenticate('user', 'pass');
>>>
>>> But the service is never called.
>>>
>>> What I´m doing wrong?
>>>
>>> Thank you
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Re%3A-Building-a-MVC-based-Soap-server-tp19002537p19101665.html
Sent from the Zend Web Services mailing list archive at Nabble.com.
没有评论:
发表评论