Generated WSDL with JaxbServiceFactory is not valid
---------------------------------------------------

                 Key: XFIRE-1014
                 URL: http://jira.codehaus.org/browse/XFIRE-1014
             Project: XFire
          Issue Type: Bug
          Components: Annotations, Generator, JAXB 2.0
    Affects Versions: 1.2.6
            Reporter: Filippo Carone
            Assignee: Dan Diephouse


Hi,
 I'm using XFire 1.2.6 to generate the WSDL from some pojos.

 The XFire configuration I'm using is:

  <bean id="xfire.serviceRegistry" 
class="org.codehaus.xfire.service.DefaultServiceRegistry" singleton="true" />
  <bean id="xfire.transportManager" 
class="org.codehaus.xfire.transport.DefaultTransportManager" singleton="true" 
init-method="initialize" destroy-method="dispose" />

  <bean id="xfire" class="org.codehaus.xfire.DefaultXFire" singleton="true">
    <constructor-arg index="0">
      <ref bean="xfire.serviceRegistry" />
    </constructor-arg>
    <constructor-arg index="1">
      <ref bean="xfire.transportManager" />
    </constructor-arg>
  </bean>
  
  <bean id="webAnnotations" 
class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations" />
  <bean id="xfire.typeMappingRegistry" 
class="org.codehaus.xfire.jaxb2.JaxbTypeRegistry" 
init-method="createDefaultMappings" singleton="true" />
  <bean id="xfire.serviceFactory" 
class="org.codehaus.xfire.jaxb2.JaxbServiceFactory">
    <property name="transportManager" ref="xfire.transportManager" />
  </bean>

  <bean id="handlerMapping" 
class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping">
    <property name="typeMappingRegistry" ref="xfire.typeMappingRegistry" />
    <property name="xfire" ref="xfire" />
    <property name="webAnnotations" ref="webAnnotations" />
    <property name="serviceFactory" ref="xfire.serviceFactory" />
    <property name="urlPrefix" value="/" />
  </bean>

  <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
      <map>
        <entry key="/">
          <ref bean="handlerMapping" />
        </entry>
      </map>
    </property>
  </bean>

Some of the exported methods return a List<MyObject>, and the strategy used for 
wsdl generation is the creation of a complexType named "ArrayOfMyObject" which 
is defined in this way (xmlns:tns="http://my.namespace.com";):

<xsd:complexType name="ArrayOfMyObject">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="myObject" 
nillable="true" type="tns:myObject" />
  </xsd:sequence>
</xsd:complexType>

later in the wsdl, within the same xsd:schema, there's the definition of 
myObject:

<xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema"; name="curve">
  <xs:complexType>
  ...
  </xs:complexType>
<xs:element> 

Validating the wsdl within eclipse gives the following error: "Cannot resolve 
the name tns:myObject to a 'type definition' component." Changing the 
ArrayOfMyObject complexType to:

<xsd:complexType name="ArrayOfMyObject">
  <xsd:sequence>
    <xsd:element maxOccurs="unbounded" minOccurs="0" ref="tns:myObject" />
  </xsd:sequence>
</xsd:complexType>

Seems to fix this issue. As a note,methods which return myObject are correctly 
defined:

      <xsd:element name="getNextMyObject">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element maxOccurs="1" minOccurs="1" ref="tns:myObject" />
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>


-- 
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

Reply via email to