zoukankan      html  css  js  c++  java
  • 【webservice】Two classes have the same XML type name(转)

    引言

    需要调用另一个系统的提供的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 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

  • 相关阅读:
    Selenium快速入门(下)
    Selenium快速入门(上)
    Python中yield和yield from的用法
    Python多进程
    Spring Cloud微服务安全实战_3-5_API安全之常见问题
    Spring Cloud微服务安全实战_3-3_API安全之流控
    Spring Cloud微服务安全实战_3-2_第一个API及注入攻击防护
    Spring Cloud微服务安全实战_3-1_API安全 常见的安全机制
    Spring Cloud微服务安全实战_2-1_开发环境
    Spring Cloud微服务安全实战_1-1_导学
  • 原文地址:https://www.cnblogs.com/yft-javaNotes/p/10357337.html
Copyright © 2011-2022 走看看