[ https://issues.apache.org/jira/browse/AXIS2-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510133 ]
Denis Rachal commented on AXIS2-2900: ------------------------------------- I apologize for the poor wording in the request. I had meant for the dom element "Expires" to be returned to the caller instead of a marshaled value, e.g. treat the element as: <xs:element name="Expires" type="xs:any" minOccurs="0"/> instead of <xs:element name="Expires" type="tns:ExpirationType" minOccurs="0"/> in the case where the "xs:type" attribute is missing from the element and just return the dom element for "Expires". In regards to the schema, this is a public schema referenced by the DMTF WS Management standard: http://www.dmtf.org/standards/published_documents/DSP0226.pdf JAXB can marshal and unmarshal objects based upon this schema without the 'xs:type' attribute being present. JAXB does not, by default, set the 'xs:type' attribute on marshalling of union types (as far as I can tell). My server is JAXB based and this is why I am experiencing the problem. As far as I know, xs:type is not required on union types, and enumeration schema as well as the WS Management schema (not yet public) do not mandate the attribute xs:type for their union types. It would go a long towards interoperability if Axis2 did not "require" this attribute. > Enhance adb binding union to default to type xs:any > --------------------------------------------------- > > Key: AXIS2-2900 > URL: https://issues.apache.org/jira/browse/AXIS2-2900 > Project: Axis 2.0 (Axis2) > Issue Type: Improvement > Components: adb > Affects Versions: 1.2 > Environment: All platforms. > Reporter: Denis Rachal > Assignee: Amila Chinthaka Suriarachchi > > adb binding support of union types expects the XML attribute xs:type to be > specified in the XML document when unmarshalling. If the xs:type attribute is > missing the unmarshal fails. This enhancement requests that if the xs:type > attribute is missing, the XML element be treated as an xs:any and unmarshal > the elemen as a dom element. > Example taken from: "http://schemas.xmlsoap.org/ws/2004/09/enumeration" > Type is 'ExpirationType'. Element set in message response is 'Expires': > <xs:simpleType name="NonNegativeDurationType"> > <xs:restriction base="xs:duration"> > <xs:minInclusive value="P0Y0M0DT0H0M0S"/> > </xs:restriction> > </xs:simpleType> > <xs:simpleType name="ExpirationType"> > <xs:union memberTypes="xs:dateTime > tns:NonNegativeDurationType"/> > </xs:simpleType> > ... > <!-- Enumerate response --> > <xs:element name="EnumerateResponse"> > <xs:complexType> > <xs:sequence> > <xs:element name="Expires" > type="tns:ExpirationType" minOccurs="0"/> > <xs:element name="EnumerationContext" > type="tns:EnumerationContextType"/> > <xs:any namespace="##other" > processContents="lax" minOccurs="0" maxOccurs="unbounded"/> > </xs:sequence> > <xs:anyAttribute namespace="##other" > processContents="lax"/> > </xs:complexType> > </xs:element> > XML document example: > If the above case, the adb binding currently expects the following and will > fail during unmarshal if the attribute 'xs:type' is not specified: > ... > <env:Body> > <wsen:EnumerateResponse xmlns:ns11="http://test.foo" > xmlns:ns12="http://examples.hp.com/ws/wsman/user"> > <wsen:Expires > xs:type="xs:dateTime">2147483647-12-31T23:59:59.999-14:00</wsen:Expires> > > <wsen:EnumerationContext>70d7063f-1639-4cda-a7db-b4fb2638b738</wsen:EnumerationContext> > </wsen:EnumerateResponse> > </env:Body > ... > If the following is sent, the adb binding should treat the value as 'xs:any' > and not throw a fault for an "Unexpected element" during unmarshal: > ... > <env:Body> > <wsen:EnumerateResponse xmlns:ns11="http://test.foo" > xmlns:ns12="http://examples.hp.com/ws/wsman/user"> > <wsen:Expires>2147483647-12-31T23:59:59.999-14:00</wsen:Expires> > > <wsen:EnumerationContext>70d7063f-1639-4cda-a7db-b4fb2638b738</wsen:EnumerationContext> > </wsen:EnumerateResponse> > </env:Body > ... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]