Use configuration in CXF to avoid adding fields that cause clients to update issues

Source: Internet
Author: User

Use configuration in CXF to avoid adding fields that cause clients to update issues

Http://www.iflym.com/index.php/code/201307310001.html

Use configuration in CXF to avoid adding fields that cause clients to update issues 2013/07/31 11:00:19 1 CommentTAGS:CXF, WebService Posted:Java Development, open source framework, programming development

When using CXF to implement WebService, the common problem is that if you modify the signature implementation of an interface on the server, such as adding a field, or deleting a field. In this case, in the default configuration, the following error message is reported:

1 org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element . Expected elements are

This error is that the client uses a transport object that does not match the field of the parameter received by the server. However, if you need to update the client every time you modify the implementation of the server, there will be some problems, such as in some cases, the client's update is not possible (such as not within their grasp, or the service can not be easily updated, or other plans).

If you avoid this problem, it is also very simple, is to disable the field information validation in CXF, if this validation is disabled, the corresponding field information will no longer be verified, and the field will not be automatically ignored. The entire solution only needs to add the following line configuration to add the following configuration entries in the Cxf.xml (Spring integration file):

123 <cxf:properties>   <entrykey="set-jaxb-validation-event-handler"value="false"/></cxf:properties>

This will disable data validation for all CXF, and in most cases this will meet our requirements (unless you have additional and CXF integrated data validation requirements).

Use configuration in CXF to avoid adding fields that cause clients to update issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.