zoukankan      html  css  js  c++  java
  • 解决由于服务器调用删除或添加字段后CXF客户端未更新导致异常问题org.apache.cxf.interceptor.Fault: Unmarshalling Error: Unexpected element

    采用CXF客户端调用Webservice服务,由于服务端时不时会对Webservice服务删除或添加一些字段,而CXF未及时更新客户端代码导致再次调用服务时报异常错误:

    Interceptor for {Mystifly.OnePoint}OnePoint#{Mystifly.OnePoint}AirRevalidate has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: Unmarshalling Error: 意外的元素 (uri:"http://schemas.datacontract.org/2004/07/Mystifly.OnePoint", local:"NameNumbers")。所需元素为<{http://schemas.datacontract.org/2004/07/Mystifly.OnePoint}Services> 

    解决这个问题有二个方式:
    1、根据最新的服务wsdl规范更新CXF客户端代码

    2、给CXF设置属性禁用CXF的Jabx对xml的检验

    client.getRequestContext().put("set-jaxb-validation-event-handler", false);

    转载:https://www.iflym.com/index.php/code/201307310001.html

  • 相关阅读:
    DS博客作业05--查找
    DS博客作业04--图
    DS博客作业03--树
    DS博客作业02--栈和队列
    DS01-线性表
    C博客作业06-结构体&文件
    C博客作业05--指针
    C博客作业04--数组
    C博客作业03--函数
    C博客作业02--循环结构
  • 原文地址:https://www.cnblogs.com/boazy/p/10570677.html
Copyright © 2011-2022 走看看