2008年8月21日星期四

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

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-tp19002537p19086477.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

没有评论: