[wsf-c-dev] [jira] Resolved: (WSFPHP-306) Response doesn't validate in WSDL mode when returning an empty array

Dimuthu Gamage (JIRA) jira at wso2.org
Thu Jul 31 06:52:52 PDT 2008


     [ https://wso2.org/jira/browse/WSFPHP-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dimuthu Gamage resolved WSFPHP-306.
-----------------------------------

         Assignee: Dimuthu Gamage
    Fix Version/s: 2.0.0
       Resolution: Fixed

As we discussed this is because the inability to provide minOccurs=0 in the wsdl schema. When you have minOccurs=0 you can always return empty array. Now in the annotation you can provide the minOccurs and maxOccurs value, (with the latest svn)

@param [0,1] string $pathWays

check https://wso2.org/repos/wso2/trunk/wsf/php/src/tests/samples/services/wsdl_generation/min_max_occurs_service.php for a test case

PS.
Your patch work for this scenario, But this fixed is more make sense, and you can try it out from 2.0 release

> Response doesn't validate in WSDL mode when returning an empty array
> --------------------------------------------------------------------
>
>                 Key: WSFPHP-306
>                 URL: https://wso2.org/jira/browse/WSFPHP-306
>             Project: WSO2 WSF/PHP
>          Issue Type: Bug
>          Components: WSDL Generation , WSDL Mode
>            Reporter: Thomas Kelder
>            Assignee: Dimuthu Gamage
>             Fix For: 2.0.0
>
>
> see: http://wso2.org/forum/thread/3884
> I'm setting up a webservice using the WSO2 WSF/php module. The service uses automatic WSDL generation from php code. One of the operations returns an array of objects, which normally works fine. However, when I return an empty array, my client in Java (using Axis2 with ADB) fails with the following error:
> org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement getRecentChangesResponse
> When I look at the xml response using soapUI, this seems ok:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <ns1:getRecentChangesResponse xmlns:ns1="http://www.wso2.org/php/xsd"/>
>    </soapenv:Body>
> </soapenv:Envelope>
> However, it doesn't validate against the definition in the wsdl:
> <xsd:element name="getRecentChangesResponse">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="pathways" maxOccurs="unbounded" type="ns1:WSPathwayInfo"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> This could be resolved by adding 'minOccurs="0"' to the xsd:sequence tag (this fixed both the xml validation and the ADB client)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the Wsf-c-dev mailing list