You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Denis Rachal (JIRA)" <ji...@apache.org> on 2007/07/04 08:36:04 UTC

[jira] Created: (AXIS2-2900) Enhance adb binding union to default to type xs:any

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


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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2900) Enhance adb binding union to default to type xs:any

Posted by "Denis Rachal (JIRA)" <ji...@apache.org>.
    [ 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Assigned: (AXIS2-2900) Enhance adb binding union to default to type xs:any

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepal Jayasinghe reassigned AXIS2-2900:
----------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-2900) Enhance adb binding union to default to type xs:any

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-2900.
-------------------------------------------------

    Resolution: Fixed

now this bug is fixed. the correct way to handle the union type is that when the xsi:type is not present it has to check it one by one (for the union types as given) and assign it for the first correct type.

> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-2900) Enhance adb binding union to default to type xs:any

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510104 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-2900:
-----------------------------------------------------

this is an schema issue. when we specifiy an union type isn't it requried to set the xsi:type? otherwice we can not determine the type requried.
On the other hand xs:any requried you to give and xml. but here we only have a string.


> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org