[ http://jira.codehaus.org/browse/XFIRE-395?page=comments#action_79247 ] Andy Latham commented on XFIRE-395: -----------------------------------
Hello Dan, I'm experiencing this exact problem using XFire version 1.2.2. I have a WSDL which is importing a schema from an external location. I'm generating classes (using the JAXB binding) from the WSDL using the wsgen Ant task and deploying my webapp to Tomcat. . All of this is working fine, however when I request the wsdl using <servicename>?WSDL on the URL the WSDL which is generated has the imported schema replicated twice. When I bind to the service using SoapUI I get a "Duplicate global type" error. I have tried working around this by pasting the external schema into the WSDL and removing the import statement, but the same problem occurs. The complex types are duplicated. n.b I'm following the same build and deployment process for other WSDLs (which don't import external schemas) and they are working perfectly which makes me think that this issue has been re-introduced since it was fixed in version 1.1.1. I'd be more than happy to share more details with you if you need me to. Kind regards, -Andy > Duplicate complexType definition in generated WSDL for type defined in > external schema > -------------------------------------------------------------------------------------- > > Key: XFIRE-395 > URL: http://jira.codehaus.org/browse/XFIRE-395 > Project: XFire > Issue Type: Bug > Reporter: Wouter > Assigned To: Dan Diephouse > Fix For: 1.1.1 > > > XFire 20060509 snapshot > When we define some complex types explicitly in an external XSD and have this > xsd included in the generated WSDL, an invalid WSDL is generated: included > types are defined twice (XML Spy says: Duplicate values for unique/key > identity constraint 'type'). > SERVICE DEFINITION in xfire-servlet.xml: > <bean name="dataXFireService" > class="org.codehaus.xfire.spring.remoting.XFireExporter"> > <property name="serviceBean"><ref bean="dataService"/></property> > <property name="serviceFactory"><ref > bean="xfire.annotationServiceFactory"/></property> > <property name="schemas"> > <list> > <value>xsd/types-adjusted.xsd</value> > </list> > </property> > </bean> > EXTERNAL TYPE DEFINITIONS in types-adjusted.xsd: > <xsd:complexType name="DataTypeMetadata" /> > <xsd:complexType name="XmlDataTypeMetadata"> > <xsd:complexContent> > <xsd:extension base="ns1:DataTypeMetadata"> > <xsd:sequence> > <xsd:element name="schema" type="xsd:string" /> > </xsd:sequence> > </xsd:extension> > </xsd:complexContent> > </xsd:complexType> > <xsd:complexType name="BinaryFileDataTypeMetadata"> > <xsd:complexContent> > <xsd:extension base="ns1:DataTypeMetadata"> > <xsd:sequence> > <xsd:element name="mimeType" type="xsd:string" > /> > <xsd:element name="originalFileName" > type="xsd:string" /> > <xsd:element name="size" type="xsd:integer" /> > </xsd:sequence> > </xsd:extension> > </xsd:complexContent> > </xsd:complexType> > SNIPPET FROM GENERATED WSDL (DataService?wsdl) > <wsdl:types> > <xsd:schema targetNamespace="http://types.func.nl" > elementFormDefault="qualified" attributeFormDefault="unqualified"> > <!-- START OF INCLUDED TYPE DEFINITIONS --> > <xsd:complexType abstract="true" name="DataTypeMetadata" /> > <xsd:complexType name="XmlDataTypeMetadata"> > <xsd:complexContent> > <xsd:extension base="ns1:DataTypeMetadata"> > <xsd:sequence> > <xsd:element name="schema" type="xsd:string" /> > </xsd:sequence> > </xsd:extension> > </xsd:complexContent> > </xsd:complexType> > <xsd:complexType name="BinaryFileDataTypeMetadata"> > <xsd:complexContent> > <xsd:extension base="ns1:DataTypeMetadata"> > <xsd:sequence> > <xsd:element name="mimeType" type="xsd:string" /> > <xsd:element name="originalFileName" type="xsd:string" /> > <xsd:element name="size" type="xsd:integer" /> > </xsd:sequence> > </xsd:extension> > </xsd:complexContent> > </xsd:complexType> > <!-- END OF INCLUDED TYPE DEFINITIONS --> > ... > <xsd:complexType name="DataTypeMetadata" /> > </xsd:schema> > ... > </wsdl:types> > Note: the duplicate type being abstract is irrelevant - the same problem > occurs when the abstract="true" attribute is left out in the xsd. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
