2009年6月23日星期二

RE: [fw-webservices] Re: Soap Server incompatiiblity with .NET Client

I am now using the trunk version of the Soap component. It resolves my
previous issue but I have uncovered another problem.

I want to return an array of objects with a method, so in the doc
comment I have the following prototype:

@return MySecondObject[]


I ended up using Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex because
Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence did not allow me gave a
fatal error:

Fatal error: Uncaught exception 'Zend_Soap_Wsdl_Exception' with message
'ArrayOfTypeSequence Strategy does not allow for complex types that are
not in @return type[] syntax. "MyFirstObject" type was specified.' In
....


The ArrayOfTypeComplex strategy generates a WSDL definition that is not
compatible with WSDL Basic 1.1 spec:
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#soapenc_Array

This is the generated WSDL snippet:

<xsd:complexType name="ArrayOfMySecondObject">
<xsd:complexContent>
<xsd:restriction base="soap-enc:Array">
<xsd:attribute ref="soap-enc:arrayType"
wsdl:arrayType="tns:MySecondObject []" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>


I manually modified this to the following:

<xsd:complexType name="ArrayOfMySecondObject">
<xsd:sequence>
<xsd:element name="MySecondObject" type="tns:MySecondObject"

minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>


The unmodified version was not properly parsed by Visual Studio 2005 as
a Web Reference (the MySecondObject was never created), but the modified
version did work.

It seems that this would be a render ZF-6349 not fixed? Or is this a
separate issue.

Fabien Crespel wrote:
>
> Ronny Srnka wrote:
> > I found that putting a call to $this->addSchemaTypeSection(); in the
> > Zend_Soap_Wsdl::__construct() fixed this.
>
> Hello,
>
> This issue was fixed by ZF-6349:
http://framework.zend.com/issues/browse/ZF-6349
>
> Please try using the current Zend_Soap trunk, with an rpc/literal
style.
>
> - Fabien.

没有评论: