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

introduction

It is necessary to call the webservice interface provided by another system, but it always reports an error after the call, but there is no problem with testing the interface with SoapUI;
it should be a problem with the code, but the same code has also called other systems without any problem, but in the end Still solved, record it now;

 

question

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

 

solve

write picture description here

Find the two classes in the error picture, and add the annotations on the classes namespace = "http://namespace.thats.not.the.same.as.the.generated", as shown below:

First class:
write picture description here

Second class:
write picture description here

 
 

Reference blog:
http://asialee.iteye.com/blog/1913480
http://damon-zhang.iteye.com/blog/1816857

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325379494&siteId=291194637