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 "Ping Liu (Updated) (JIRA)" <ji...@apache.org> on 2011/11/14 21:16:51 UTC

[jira] [Updated] (AXIS2-4859) Optional "Ignore Unexpected Elements" mode - allows for forward-compatible clients

     [ https://issues.apache.org/jira/browse/AXIS2-4859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ping Liu updated AXIS2-4859:
----------------------------

    Attachment: names_v2_service.zip
                names_v2_client.zip
                names_v1_service.zip
                names_v1_client_with_xsl_change.zip
                names_v1_client.zip
                names_v2.wsdl
                iu.patch

This is the update for this issue.

1. the issue is still there, not fixed yet;

2. there have been changes here and there since previous patch was provided.  Therefore, new patch (iu.patch) has to be provided.  Fortunately, the update is not significant;

3. the patch works
	- allows client code to be re-generated with command option of "-Eiu"
	- the re-generated client code will ignore new elements instead of throwing exception on encountering new elements
	- test has been done for all cases that Dean iterated: xsd:sequence, xsd:choice, xsd:any, xsd:all

4. following are the details

	- WSDLs:
		names_v1.wsdl (used the original attached names_v1.wsdl)
		names_v2.wsdl, a new WSDL based on names_v1.wsdl but contains extended elements (with all test types)

	- auto code generation command line arguments

		for service:
			wsdl2java -wv 1.1 -or -ss -sd -uri names_v1.wsdl -o names_v1_service
			wsdl2java -wv 1.1 -or -ss -sd -uri names_v2.wsdl -o names_v2_service

		for client:
			wsdl2java -wv 1.1 -or -sd -uri names_v1.wsdl -o names_v1_client
			wsdl2java -wv 1.1 -or -sd -uri names_v2.wsdl -o names_v2_client

			wsdl2java -wv 1.1 -or -sd -uri names_v1.wsdl -o names_v1_client_with_xsl_change (after applying the patch changes)

	- simple primitive implementations for demonstration purpose have been added to all services and clients

	- deployed names_v1_service, names_v2_service 

	- verified names_v1_client works with names_v1_service, but fails with names_v2_service (this is to verify that the reported issue still exists)

	- verified names_v2_client works with names_v2_service (another way to verify the names_v2.wsdl is correct)

	- applied patch and generated names_v1_client_with_xsl_change

	- verified names_v1_client_with_xsl_change still works with names_v1_service but now also works with names_v2_service (this is to verify the patch works)

	- attachment:
		iu.patch
		names_v2.wsdl (names_v1.wsdl is the original attachment by Dean)
		names_v1_service.zip
		names_v1_client.zip
		names_v2_service.zip
		names_v2_client.zip
		names_v1_client_with_xsl_change.zip

5. comment:

	- "-Eiu" command option is used for client re-generation only, this option is not for service generation (a scenario can be like this: upon a service call failed due to new element introduced on service, regenerate client with "-Eiu" option (this means having to swap in previous client implementation into the newly generated client code), the new client should work as before)

	- "-Eiu" should be used in caution as the option will make the code generator ignore all new elements regardless (it should be double checked to differentiate the case where new element is intended to be ignored and the potential error case where client code generation does not generate the element that is supposed to be generated)
                
> Optional "Ignore Unexpected Elements" mode - allows for forward-compatible clients
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-4859
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4859
>             Project: Axis2
>          Issue Type: New Feature
>          Components: codegen
>    Affects Versions: 1.5.2, 1.5.3, 1.6.0
>            Reporter: Dean Holdren
>         Attachments: iu.patch, iu_1_5.patch, iu_trunk.patch, names_v1.response, names_v1.wsdl, names_v1_client.zip, names_v1_client_with_xsl_change.zip, names_v1_service.zip, names_v2.response, names_v2.wsdl, names_v2_client.zip, names_v2_service.zip
>
>
> Problem: Service provider adds an optional element to the responses it sends, assuming client can handle, while client is unaware and has not (or cannot) retrieve updated WSDL and regenerate client.  Axis2 client generated with ADB, cannot handle and throws an exception.
> Solution:
> Optional "Ignore Unexpected Elements" mode for wsdl2java using adb - allows for forward-compatible clients that can recover from unxpected elements in service responses.
> Based on the work in Issue 3037 - This patch is more up to date, is for both trunk and 1_5 branch, handles more scenarios, and will correctly parse the portion of the response after the unexpected element.
> To use, pass the "-Eiu" parameter to wsdl2java
> Handles the following scenarios:
> 1) unexpected element in a xsd:choice, xsd:any, xsd:all
> 2) appended unexpected element in a xsd:sequence.
> For xsd:sequence, the unexpected element, and subsequent elements within that sequence are not captured. If a service adds a new element within a sequence, it should be *appended*, as the generated client is strict with ordering, and can't differentiate an out-of-order sequence from an additional inserted element.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org