2008年8月7日星期四

[fw-webservices] Can Zend_Soap_Server handle "simpleType" elements? 7A2-99B

It appears my message was blocked… resending according to the instructions…

 

From: Dieter Devlieghere
Sent: donderdag 7 augustus 2008 16:41
To: fw-webservices@lists.zend.com
Subject: Can Zend_Soap_Server handle "simpleType" elements?

 

I have a problem with the Zend_Soap_Server.

 

I have a WSDL that has a definition for a simple type in it:

            <xs:simpleType name="remarkstring">

                        <xs:restriction base="xs:string">

                                   <xs:maxLength value="50"/>

                                   <xs:minLength value="1"/>

                        </xs:restriction>

            </xs:simpleType>

 

This simple type is part of complex type:

<xs:complexType name="FilterScript_FilterPnrRequest">

            <xs:all>

                        <xs:element minOccurs="1" maxOccurs="1" name="recordlocator" type="xs:string"/>

                        <xs:element minOccurs="1" maxOccurs="1" name="officeid" type="xs:string"/>

                        <xs:element minOccurs="1" maxOccurs="1" name="queueIfAba" type="tns:FilterScript_GdsQueue"/>

                        <xs:element minOccurs="1" maxOccurs="1" name="queueIfAbc" type="tns:FilterScript_GdsQueue"/>

                        <xs:element minOccurs="0" maxOccurs="1" name="remarkIfAbc" type="tns:remarkstring"/>

            </xs:all>

</xs:complexType>

 

This complex type is automatically bound to this PHP class:

 

class FilterScript_FilterPnrRequest {

                /**

                 * @var string

                 */

                public $recordlocator;

                /**

                 * @var string

                 */

                public $officeid;

                /**

                 * @var FilterScript_GdsQueue

                 */

                public $queueIfAba;

                /**

                 * @var FilterScript_GdsQueue

                 */

                public $queueIfAbc;

                /**

                 * @var string

                 */

                public $remarkIfAbc;

}

 

The binding works, except the $remarkIfAbc: this variable is always empty. Since I based the definition of the simpleType remarkstring on the string datatype, this should work.

Also, if I send a soap message to my server with a remarkstring of more than 50 characters, the soap-server should send a “SOAP-ERROR: Encoding: Violation of encoding rules” error. It doesn’t do this.

 

I suspect the Zend_Soap_Server is not capable of working with simpleTypes defined in the WSDL. Is this correct (or is it a bug ;)) ?

 

If this is a “todo”: will there be support for simpleTypes anytime soon?

 

Greetings,

Dieter Devlieghere

 

没有评论: