tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Feng" <enjoyj...@gmail.com>
Subject Re: Wrong generated WSDL
Date Thu, 07 May 2009 17:07:15 GMT
We have a test case at [1] based on TUSCANY-2853.

[1] 
https://svn.apache.org/repos/asf/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo

--------------------------------------------------
From: "Simon Laws" <simonslaws@googlemail.com>
Sent: Thursday, May 07, 2009 8:50 AM
To: <user@tuscany.apache.org>
Subject: Re: Wrong generated WSDL

> So what I find with a quick test is the following.
>
> With a bean..
>
> package helloworld;
>
> public class ABean {
>
>    protected String field1;
>    protected String field2;
>
> An a service inteface..
>
> public interface HelloWorldService {
>
>    public String getGreetings(String name);
>    public String getGreetingsBean(ABean bean);
>    public String getGreetingsBeanArray(ABean[] bean);
> }
>
> And a package-info.java
>
> @javax.xml.bind.annotation.XmlSchema(namespace="http://test")
> package helloworld;
>
> I get the following generated WSDL types from Tuscany...
>
> <wsdl:types>
>    <xs:schema targetNamespace="http://test" version="1.0"
>        xmlns:tns="http://test" 
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>        <xs:complexType name="aBean">
>            <xs:sequence>
>                <xs:element minOccurs="0" name="field1" type="xs:string" />
>                <xs:element minOccurs="0" name="field2" type="xs:string" />
>            </xs:sequence>
>        </xs:complexType>
>        <xs:complexType final="#all" name="aBeanArray">
>            <xs:sequence>
>                <xs:element maxOccurs="unbounded" minOccurs="0"
>                    name="item" nillable="true" type="tns:aBean" />
>            </xs:sequence>
>        </xs:complexType>
>    </xs:schema>
>    <xs:schema attributeFormDefault="qualified"
>        elementFormDefault="unqualified" 
> targetNamespace="http://helloworld/"
>        xmlns:ns0="http://test" 
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>        <xs:import namespace="http://test" />
>        <xs:element name="getGreetingsBean">
>            <xs:complexType>
>                <xs:sequence>
>                    <xs:element minOccurs="0" name="arg0"
>                        nillable="true" type="ns0:aBean" />
>                </xs:sequence>
>            </xs:complexType>
>        </xs:element>
>        <xs:element name="getGreetings">
>            <xs:complexType>
>                <xs:sequence>
>                    <xs:element minOccurs="0" name="arg0"
>                        nillable="true" type="xs:string" />
>                </xs:sequence>
>            </xs:complexType>
>        </xs:element>
>        <xs:element name="getGreetingsResponse">
>            <xs:complexType>
>                <xs:sequence>
>                    <xs:element minOccurs="0" name="return"
>                        nillable="true" type="xs:string" />
>                </xs:sequence>
>            </xs:complexType>
>        </xs:element>
>        <xs:element name="getGreetingsBeanResponse">
>            <xs:complexType>
>                <xs:sequence>
>                    <xs:element minOccurs="0" name="return"
>                        nillable="true" type="xs:string" />
>                </xs:sequence>
>            </xs:complexType>
>        </xs:element>
>        <xs:element name="getGreetingsBeanArrayResponse">
>            <xs:complexType>
>                <xs:sequence>
>                    <xs:element minOccurs="0" name="return"
>                        nillable="true" type="xs:string" />
>                </xs:sequence>
>            </xs:complexType>
>        </xs:element>
>        <xs:element name="getGreetingsBeanArray">
>            <xs:complexType>
>                <xs:sequence>
>                    <xs:element maxOccurs="unbounded"
>                        minOccurs="0" name="arg0" nillable="true"
> type="ns0:aBean" />
>                </xs:sequence>
>            </xs:complexType>
>        </xs:element>
>    </xs:schema>
> </wsdl:types>
>
>
> Which validates for me. Haven't actually tries generating a client
> from it but it looks OK. So if you can live with this this should get
> you going. I'm not sure how to get vectors to work.
>
> We do need a JIRA to cover this very common case as it's a real
> gotcha. I note that https://issues.apache.org/jira/browse/TUSCANY-2853
> was actually closed when in reality we just use a work around. I'll
> reopen it and add some notes.
>
> Simon 


Mime
View raw message