2010年12月9日星期四

[fw-webservices] Re: [Zend_Soap_AutoDiscover] Use Duration primitif datatype

Hello,

1 - I created Camelot_Soap_W3C class :
http://pastebin.com/2dqasGvL http://pastebin.com/2dqasGvL

2 - I installed Zend Framework 1.11.1

3 - I defined my service with duration type :
--------------------
<?php
class MyService {

/**
* External service who return a primitif duration Type
* @return Duration
*/
public function myMethod()
{
$soapClient = new SoapClient(ANOTHER_WSDL_SERVICE);
return $soapClient ->getDuration();
}
}
--------------------

4 - I changed Zend_Soap_AutoDiscover :
--------------------
$autodiscover = new
Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex', null,
'Camelot_Soap_W3C');
$autodiscover->setClass('MyService'); // Error
--------------------

But I have an exception :

"Zend_Soap_Wsdl_Exception: Cannot add a complex type duration that is not an
object or where class could not be found in 'DefaultComplexType' strategy.
in
/var/www/sharelib/ZendFramework-1.11.1/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php
on line 68"

Have you any idea ?

Thanks


RQuadling wrote:
>
> On 8 December 2010 09:32, Arnaud Lemercier <arnolem@free.fr> wrote:
>>
>> Hello,
>>
>> I am building a WDSL with Zend_Soap_AutoDiscover.
>> I want to add a Duration primitive datatype (
>> http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes
>> http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes ) like a
>> string or a struct.
>>
>> -----------------------------------
>> Example of code :
>> -----------------------------------
>> <?php
>> class MyService {
>>
>>    /**
>>     * External service who return a primitif duration Type
>>     * @return Duration
>>     */
>>    public function myMethod()
>>    {
>>        $soapClient = new SoapClient(ANOTHER_WSDL_SERVICE);
>>        return $soapClient ->getDuration();
>>    }
>>
>> }
>>
>> $autodiscover = new Zend_Soap_AutoDiscover();
>> $autodiscover->setClass('MyService');
>> var_dump($autodiscover->getType('Duration')); // Error
>> -----------------------------------
>>
>> So that this code works, I must create a class "Duration" but it
>> generates a
>> SOAP type ns1:Duration instead of primitif xsd:duration
>>
>> How to make this ?
>>
>> Thanks
>> --
>> View this message in context:
>> http://zend-framework-community.634137.n4.nabble.com/Zend-Soap-AutoDiscover-Use-Duration-primitif-datatype-tp3077924p3077924.html
>> Sent from the Zend Web Services mailing list archive at Nabble.com.
>>
>
> I used the following mechanism ...
>
> http://pastebin.com/2dqasGvL
>
> and
>
> $this->SoapHandler = new Zend_Soap_AutoDiscover
> (
> 'Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex',
> 'http://' . self::SOAP_SERVER_URL . "/{$RequestedService}",
> 'Camelot_Soap_W3C'
> );
>
> and this is now supported in
> http://framework.zend.com/apidoc/1.11/Zend_Soap/AutoDiscover/Zend_Soap_AutoDiscover.html#__construct
>
> Only the latest release supports the user defined wsdl class.
>
> I've got the patch I supplied (somewhere) if you need it for an older
> release.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
>


-----
Sorry for my english, I am french ;)
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Soap-AutoDiscover-Use-Duration-primitif-datatype-tp3077924p3079911.html
Sent from the Zend Web Services mailing list archive at Nabble.com.

没有评论: