Soap Server incompatiiblity with .NET Client

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Soap Server incompatiiblity with .NET Client

Ronny Srnka
Hello

I have come across an incompatibility that the Soap Server has with the
.NET Soap Client. When loading a WSDL generated by
Zend_Soap_Autodiscover as a Web Reference in Visual Studio, if there are
no objects/complex types in the WSDL signature, then that WSDL is not
loaded successfully. I found that the problem is when "types" tag and
"xsd:schema" tag, inside that, is missing from the WSDL. It must be
there and empty at the least:

<types>
       <xsd:schema targetNamespace="http://mynamespace.com"/>
</types>

I found that putting a call to $this->addSchemaTypeSection(); in the
Zend_Soap_Wsdl::__construct() fixed this.

Is this seen as a bug in Visual Studio or is it a shortcoming of
Zend_Soap_Autodiscover and Zend_Soap_Wsdl? And either way should there
not be a work around to ensure compatibility with .NET?

In our company we have to be sure that our web services are consumable
(and easy to use) by .NET clients. For now my work around will be to
have a dummy method that has an object as a parameter, though this is
not optimal.

Thanks,
ronny
Reply | Threaded
Open this post in threaded view
|

Re: Soap Server incompatiiblity with .NET Client

Benjamin Eberlei-2
hello ronny,

can you open up an issue in Jira Issue tracker? This way i will find it better.
I'll look into it then :)

greetings,
Benjamin

On Thursday 18 June 2009 04:58:17 pm Ronny Srnka wrote:

> Hello
>
> I have come across an incompatibility that the Soap Server has with the
> .NET Soap Client. When loading a WSDL generated by
> Zend_Soap_Autodiscover as a Web Reference in Visual Studio, if there are
> no objects/complex types in the WSDL signature, then that WSDL is not
> loaded successfully. I found that the problem is when "types" tag and
> "xsd:schema" tag, inside that, is missing from the WSDL. It must be
> there and empty at the least:
>
> <types>
>        <xsd:schema targetNamespace="http://mynamespace.com"/>
> </types>
>
> I found that putting a call to $this->addSchemaTypeSection(); in the
> Zend_Soap_Wsdl::__construct() fixed this.
>
> Is this seen as a bug in Visual Studio or is it a shortcoming of
> Zend_Soap_Autodiscover and Zend_Soap_Wsdl? And either way should there
> not be a work around to ensure compatibility with .NET?
>
> In our company we have to be sure that our web services are consumable
> (and easy to use) by .NET clients. For now my work around will be to
> have a dummy method that has an object as a parameter, though this is
> not optimal.
>
> Thanks,
> ronny


--
Benjamin Eberlei
http://www.beberlei.de
Reply | Threaded
Open this post in threaded view
|

Re: Soap Server incompatiiblity with .NET Client

Bugzilla from fabien@crespel.net
In reply to this post by Ronny Srnka
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.

Reply | Threaded
Open this post in threaded view
|

RE: Re: Soap Server incompatiiblity with .NET Client

Ronny Srnka
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.

Reply | Threaded
Open this post in threaded view
|

Re: Soap Server incompatiiblity with .NET Client

Bugzilla from fabien@crespel.net
Ronny Srnka wrote:
> I am now using the trunk version of the Soap component. It resolves my
> previous issue

Good news!

> 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
> ....
> [...]
>
> It seems that this would be a render ZF-6349 not fixed? Or is this a
> separate issue.
>

This is a separate issue for which you can find a patch in ZF-6742:
http://framework.zend.com/issues/browse/ZF-6742

So I would recommend using ArrayOfTypeSequence with the 'v2' patch. I hope it
will be applied to the official trunk before 1.9 ... it is not the best solution,
but it is simple and solves that particular issue.

- Fabien.