2010年12月8日星期三

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

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

没有评论: