SOAP测试程序:两个声明在ObjectFactory类中导致冲突

时间:2012-03-27 11:45:34

标签: java soap netbeans xsd

当我为SOAP Web服务打开测试程序时,它在网页上显示以下错误:

Exceptions details : null

com.sun.tools.ws.wscompile.AbortException at 
com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:144) at 
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2244) at 
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:191) at 
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:137) at 
com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:381) at 
com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:198) at 
com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:179) at 
com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsimport(WSToolsObjectFactoryImpl.java:60) at 
com.sun.tools.ws.spi.WSToolsObjectFactory.wsimport(WSToolsObjectFactory.java:88) at 
org.glassfish.webservices.monitoring.WebServiceTesterServlet.wsImport(WebServiceTesterServlet.java:626) at 
org.glassfish.webservices.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:522) at 
org.glassfish.webservices.monitoring.WebServiceTesterServlet.doGet(WebServiceTesterServlet.java:169) at 
org.glassfish.webservices.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:104) at 
org.glassfish.webservices.JAXWSServlet.doGet(JAXWSServlet.java:186) at .....

GlassFish日志包含:

INFO: [ERROR] Two declarations cause a collision in the ObjectFactory class.
INFO:   line 341 of http://localhost:8080/RegistratieProject/UpdateService?xsd=1
INFO: [ERROR] (Related to above error) This is the other declaration.   
INFO:   line 334 of http://localhost:8080/RegistratieProject/UpdateService?xsd=1

生成一切。 xsd行:

  <xs:complexType name="typeUpdate">
    <xs:sequence> <== LINE 334
      <xs:element name="action" type="xs:int"/>
      <xs:element name="tagCollection" type="tns:tags" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="typeObject" type="tns:type" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="getLocationUpdates"> <== LINE 341
    <xs:sequence>
      <xs:element name="companyID" type="xs:long"/>
      <xs:element name="pw" type="xs:string" minOccurs="0"/>
      <xs:element name="from" type="xs:dateTime" minOccurs="0"/>
      <xs:element name="deviceID" type="xs:string" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

任何人都可以解释发生了什么,也许可以解决这个问题?

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。与其成员相比,某些属性名称的名称错误。使用插入代码很容易检查NetBeans中的所有类。