@XmlType.name 和 @XmlType.namespace 为类分配不同的名称

Caused by: org.apache.cxf.service.factory.ServiceConstructionException
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:329)
	at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:434)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:538)
	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:252)
	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:155)
	at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:156)
	at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:469)
	at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:484)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)
	... 40 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of IllegalAnnotationExceptions
两个类具有相同的 XML 类型名称 "{http://client.ws.logink.org/AuthenService}isTokenValiedResponse"。请使用 @XmlType.name 和 @XmlType.namespace 为类分配不同的名称。
	this problem is related to the following location:
		at com.intelink.logink.authenService.jaxws_asm.IsTokenValiedResponse
	this problem is related to the following location:
		at com.intelink.logink.authenService.IsTokenValiedResponse
		at public com.intelink.logink.authenService.IsTokenValiedResponse com.intelink.logink.authenService.ObjectFactory.createIsTokenValiedResponse()
		at com.intelink.logink.authenService.ObjectFactory
两个类具有相同的 XML 类型名称 "{http://client.ws.logink.org/AuthenService}authenticate"。请使用 @XmlType.name 和 @XmlType.namespace 为类分配不同的名称。
	this problem is related to the following location:
		at com.intelink.logink.authenService.jaxws_asm.Authenticate
	this problem is related to the following location:
		at com.intelink.logink.authenService.Authenticate
		at public javax.xml.bind.JAXBElement com.intelink.logink.authenService.ObjectFactory.createAuthenticate(com.intelink.logink.authenService.Authenticate)
		at com.intelink.logink.authenService.ObjectFactory

   以上错误是由于将webservice下载下来的包路径改成了自己项目的包路径。

   解决办法:

  

	@WebMethod
	@WebResult(name = "AuthenticationResult", targetNamespace = "")
	@RequestWrapper(localName = "isTokenValied", targetNamespace = "http://client.ws.logink.org/AuthenService", className = "com.intelink.logink.authenService.IsTokenValied")
	@ResponseWrapper(localName = "isTokenValiedResponse", targetNamespace = "http://client.ws.logink.org/AuthenService", className = "com.intelink.logink.authenService.IsTokenValiedResponse")
	public AuthenticationResult isTokenValied(
			@WebParam(name = "applicantToken", targetNamespace = "") String applicantToken,
			@WebParam(name = "userToken", targetNamespace = "") String userToken,
			@WebParam(name = "resource", targetNamespace = "") String resource)
			throws ServiceException_Exception;

   将className改成自己项目对应的包路径

 

你可能感兴趣的:(webservice,微风,@XmlType.name)