分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

【webservice】Two classes have the same XML type name(转)

发布时间:2023-09-06 02:32责任编辑:胡小海关键词:webserviceclass

引言

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

问题

Exception in thread "main" com.sun.xml.internal.ws.spi.db.DatabindingException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptionsTwo 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.ProxyFunctionTwo 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(转)

原文地址:https://www.cnblogs.com/yft-javaNotes/p/10357337.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved