(on Wednesday, 27 January 2010, 10:03 AM +0000):
> 2010/1/25 Richard Quadling <rquadling@googlemail.com>:
> > I'm in the process of building a web service which incorporates the
> > ability for the server to inform the client that a particular call has
> > been superseded by another.
> >
> > So, cut down (I've removed all the other details), ...
> >
> > class ServiceDetails
> > {
> > /**
> > * Superseded by
> > *
> > * Details of the replacement service that is now available.
> > *
> > * @var ServiceDetails
> > */
> > public $SupersededBy = Null;
> > }
> >
> > When I try to use Zend_Soap_AutoDiscover() against this class, I get ...
> >
> > "Infinite recursion, cannot nest 'ServiceDetails' into itsself." (sic)
> >
> > There has to be recursion, as there could be many levels of
> > supersedence, each one providing the details of their own replacement.
> >
> > The call to return the service details read the requested
> > services/class constants. If there is a superseded entry, it creates a
> > new request for service details on the new class (the recursion).
> >
> > If the value is Null, then there is no recursion.
> >
> >
> >
> > I'm using ...
> >
> > new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
> >
> > as the strategy as the service has arrays of complex types in the output.
> >
> >
> >
> > If I use @var string and then manually replace the type in the WSDL
> > file from ...
> >
> > <xsd:element name="SupersededBy" type="xsd:string" />
> >
> > to
> >
> > <xsd:element name="SupersededBy" type="tns:ServiceDetails" />
> >
> > and use wsdl2php against this, it all _SEEMS_ to work OK.
> >
> > So. Is this my best option? Or is there a way to do this that I'm missing?
> >
> >
> > Any ideas really.
> >
> >
> > Is this even a bug in the Zend_Soap_AutoDiscover class?
>
> I amended Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex::addComplexType().
>
> Changing the (sic) ...
>
> throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest
> '".$type."' into itsself.");
>
> to ...
>
> return "tns:$type";
>
> and all is working just fine.
>
> Obviously, I may be breaking something here, but I've not come across
> it yet. Early days .... !
Can you open an issue in the tracker and provide a test case and your
patch? This does sound like a bug, and from what you've described, I
think you hit on the appropriate solution.
--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
没有评论:
发表评论