I am trying to figure out if this is a bug in XFire or just a
misunderstanding on my part. Let me describe the scenario:

1) You have the following schema:
<xs:schema targetNamespace="uri:my-namespace"
elementFormDefault="qualified">
   <xs:element name="myDoc">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="subnode" maxOccurs="1" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

Note the [elementFormDefault="qualified"] attribute on the schema root
element.

Applying the JAXB2 XJC compiler to this schema and then instantiating a
myDoc object and passing it to a web service method produces XML like this
in the request (I am omitting the soap:body and soap:envelope elements for
brevity):

<mydoc xmlns="uri:my-namespace">
    <subnode />
</mydoc>

and this is bound properly on the service side and passed to the web
service fine. However,

2) If I slightly modify the schema thus:

<xs:schema targetNamespace="uri:my-namespace"
elementFormDefault="unqualified">
   <xs:element name="myDoc">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="subnode" maxOccurs="1" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

where now the elementFormDefault attribute is set to "unqualified", the
myDoc object is marshalled something like this into the request:

<ns0:mydoc xmlns:ns0="uri:my-namespace">
   <subnode/>
</ns0:mydoc>

which is correct according to my understanding of this stuff and should be
fine. However, when the service side unmarshalls this XML, it produces a
myDoc object with a null subnode member, i.e. the subnode element was not
bound properly. 

Is there something special I have to do to make things work when the
elementFormDefault is unqualified?

Thanks,
Stan


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .



---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to