引言

需要调用另一个系统的提供的webservice接口,但是调用之后总是报错,用SoapUI测试接口却没有问题;
那就应该是代码的问题了,但是同样的代码也调用过其他系统却没有问题,不过最终还是解决了,现在记录一下;

问题

Exception in thread "main" com.sun.xml.internal.ws.spi.db.DatabindingException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:  counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://app.fms.com/}proxyFunction". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at datasource.rebuild.com.fms.app.ProxyFunction
at public javax.xml.bind.JAXBElement datasource.rebuild.com.fms.app.ObjectFactory.createProxyFunction(datasource.rebuild.com.fms.app.ProxyFunction)
at datasource.rebuild.com.fms.app.ObjectFactory
this problem is related to the following location:
at com.fms.app.ProxyFunction
Two classes have the same XML type name "{http://app.fms.com/}proxyFunctionResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at datasource.rebuild.com.fms.app.ProxyFunctionResponse
at public javax.xml.bind.JAXBElement datasource.rebuild.com.fms.app.ObjectFactory.createProxyFunctionResponse(datasource.rebuild.com.fms.app.ProxyFunctionResponse)
at datasource.rebuild.com.fms.app.ObjectFactory
this problem is related to the following location:
at com.fms.app.ProxyFunctionResponse

解决

找到报错图片里面的那两个类,在类上的注解加上namespace = "http://namespace.thats.not.the.same.as.the.generated",如下所示:

第一个类:

第二个类:

转自:https://blog.csdn.net/Francis123580/article/details/79485138

【webservice】Two classes have the same XML type name(转)的更多相关文章

  1. 【Webservice】2 counts of IllegalAnnotationExceptions Two classes have the same XML type name

    在使用客户端调用服务端的时候发生了2 counts of IllegalAnnotationExceptions Two classes have the same XML type name的错误, ...

  2. Two classes have the same XML type name 排错【转】

    今天遇到一个问题,webservice发布的时候报下面的错误: <strong>Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotati ...

  3. CXF报错[1 counts of IllegalAnnotationExceptions]and[Two classes have the same XML type name]and[Use @XmlType.name and @XmlType.namespace to assign different names to them]

    启动时CXF报错如下: Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalA ...

  4. webservice接口测试wsdl,参数是xml格式。python,入参转化成str,返回值转化成dict调用

    1.用SoapUI测试webservice接口,传入参数是xml格式时.xml格式需要将xml的外围增加<![CDATA[xml]]> 2.但是用python去做webservice测试, ...

  5. WebService如何根据对方提供的xml生成对象

    最近写接口接到一个需求,就是他们推送数据过来,我们这边来提供服务接口. 对方用的是.NET WebService,已经把所有的对象格式定义好了,可能是为了顾及各个平台的通用性,所以只在文档中提供了xm ...

  6. 有WebService的项目中写applicationContex.xml文件时应注意!!!

    这是一个简单的WebService实例,来看下如下的applicationContex.xml文件: 1.有XFire的配置 <bean id="baseWebService" ...

  7. Maven项目编译后classes文件中没有.xml问题

    在做spring+mybatiss时,自动扫描都配置正确了,却在运行时出现了如下错误.后来查看target/classes/.../dao/文件夹下,发现只有mapper的class文件,而没有xml ...

  8. [原]Maven项目编译后classes文件中没有.xml问题

    在做spring+mybatiss时,自动扫描都配置正确了,却在运行时出现了如下错误.后来查看target/classes/.../dao/文件夹下,发现只有mapper的class文件,而没有xml ...

  9. 手把手教你SOAP访问webservice并DOM解析返回的XML数据(转)

    http://blog.csdn.net/u012534831/article/details/51357111 前言: 目前我们项目组还在采用webservice这种http方式,并且某些网站服务提 ...

随机推荐

  1. UIAtlas

    [UIAtlas] UIAtlas is a container that has coordinate information for a bunch of sprites. AtlasType有2 ...

  2. http头部信息解析

    HTTP 头部解释 1. Accept:告诉WEB服务器自己接受什么介质类型,*/* 表示任何类型,type/* 表示该类型下的所有子类型,type/sub-type. 2. Accept-Chars ...

  3. css四可见,部分可见和重叠半透明

    <html> <head> <title>javascript</title> <style type="text/css"& ...

  4. hadoop搭建好,启动服务后,无法从web界面访问50070

    在hadoop完全分布式搭建好以后,从主节点启动正常,使用jps查看启动的进程,正常,在几个从节点上使用jps查看,显示正常,但从web上输入下面网址: http://主节点IP:50070 无法正常 ...

  5. HighCharts SVN IReport进行PDF报表设计--模板

    BOS物流项目笔记第十五天 HIghcharts是很强大的图表绘制插件,它是基于纯js绘制的.当然地,对于图表也会有很多操作了.下面就我工作时遇到的一些比较常见的highcharts的操作进行小结,不 ...

  6. linux蓝屏时间修改

    setterm -blank 2   #/etc/profile里添加这样一句话,可以让屏幕2分钟后没有信号(蓝屏) setterm -blank 0   #/etc/profile里添加这样一句话, ...

  7. Monkey稳定性测试环境搭建说明

    一.安装Java环境 安装Java环境-JDK:下载地址:http://pan.baidu.com/s/1pJ6Yqs7,jdk安装解压即可. 二.设置环境变量 双击下载的JDK ,设置安装路径.这里 ...

  8. TP5多入口设置

    今天在用tp5做项目的时候发现,前台是可以绑定默认到index模块的,但是后台不好弄,于是查了一下手册,按照手册上说的,复制了index.php改为admin.php,作为后台的入口文件,于是域名/a ...

  9. NAO机器人

    NAO机器人是Aldebaran Robotics公司研制的一款人工智能机器人.它拥有着讨人喜欢的外形,并具备有一定程度的人工智能和约一定程度的情感智商并能够和人亲切的互动. 教学研究类/NAO机器人 ...

  10. Listview 利用Datapager进行分页

    原文:http://lgm9128.blog.163.com/blog/static/421734292010513111851101/ <asp:ListView ID="ListV ...