Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
wsdl的java wsimport问题(jax ws)_Java_Jax Ws_Wsimport - Fatal编程技术网

wsdl的java wsimport问题(jax ws)

wsdl的java wsimport问题(jax ws),java,jax-ws,wsimport,Java,Jax Ws,Wsimport,有人能帮我看看WSDL文件有什么问题吗 wsimport -d test uri_to_my_wsdl parsing WSDL... [WARNING] src-resolve: Cannot resolve the name 'ns1:HeaderType' to a(n) 'type definition' component. line 27 of uri_to_my_wsdl=anotherWS.wsdl#types?schema2 [ERROR] A class/inter

有人能帮我看看WSDL文件有什么问题吗

wsimport -d test uri_to_my_wsdl
parsing WSDL...


[WARNING] src-resolve: Cannot resolve the name 'ns1:HeaderType' to a(n) 'type definition' component.
  line 27 of uri_to_my_wsdl=anotherWS.wsdl#types?schema2

[ERROR] A class/interface with the same name "some_pkg.ObjectFactory" is already in use. Use a class customization to resolve this conflict.


[ERROR] (Relevant to above error) another "ObjectFactory" is generated from here.
  line 72 of uri_to_my_wsdl=anotherWS.wsdl

Exception in thread "main" java.lang.NullPointerException
    at com.sun.tools.internal.xjc.util.Util.equals(Util.java:56)
    at com.sun.tools.internal.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:119)
    at com.sun.tools.internal.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:66)
    at com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy$1.createClasses(ImplStructureStrategy.java:67)
    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generateClassDef(BeanGenerator.java:392)
    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.getClazz(BeanGenerator.java:424)
    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:191)
    at com.sun.tools.internal.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:164)
    at com.sun.tools.internal.xjc.model.Model.generateCode(Model.java:275)
    at com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:240)
    at com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:74)
    at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:123)
    at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2234)
    at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:176)
    at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:122)
    at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:172)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:111)
    at com.sun.tools.internal.ws.WsImport.main(WsImport.java:41)
wsimport-d测试uri到我的wsdl
正在分析WSDL。。。
[警告]src resolve:无法将名称“ns1:HeaderType”解析为(n)“类型定义”组件。
uri_to_my_wsdl=anotherWS.wsdl#types?schema2的第27行
[错误]同名“some_pkg.ObjectFactory”的类/接口已在使用中。使用类自定义来解决此冲突。
[错误](与上述错误相关)从这里生成另一个“ObjectFactory”。
uri_to_my_wsdl=anotherWS.wsdl的第72行
线程“main”java.lang.NullPointerException中出现异常
位于com.sun.tools.internal.xjc.util.util.equals(util.java:56)
位于com.sun.tools.internal.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:119)
位于com.sun.tools.internal.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:66)
在com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy$1.createClasses上(ImplStructureStrategy.java:67)
位于com.sun.tools.internal.xjc.generator.bean.BeangGenerator.generateClassDef(BeangGenerator.java:392)
在com.sun.tools.internal.xjc.generator.bean.BeangGenerator.getClazz(BeangGenerator.java:424)
位于com.sun.tools.internal.xjc.generator.bean.BeangGenerator(BeangGenerator.java:191)
位于com.sun.tools.internal.xjc.generator.bean.BeangGenerator.generate(BeangGenerator.java:164)
位于com.sun.tools.internal.xjc.model.model.generateCode(model.java:275)
位于com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:240)
位于com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:74)
位于com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:123)
位于com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2234)
位于com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:176)
位于com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:122)
位于com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:172)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)中
位于java.lang.reflect.Method.invoke(Method.java:597)
位于com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:111)
位于com.sun.tools.internal.ws.WsImport.main(WsImport.java:41)
因为WS不是公共的,所以我不能在这里发布WSDL的真实路径。
我可以通过电子邮件或其他私人信息发送给您。

您可以放心地忽略这些警告。我正在对我的WSDL做同样的操作,因为生成的存根包含我需要的内容

关于错误,它清楚地表示WSDL中存在重复的ObjectFactory。 请使用与下面类似的模式自定义方案



我在你的第一篇文章中提到了“[WARNING]src resolve:”。对于我提到的错误,您已经多次定义了“ObjectFactory”。OK。同意。但是我能为“ObjectFactory”做些什么呢?我知道有某种jaxb映射文件,但我还没有找到如何编写它。一些示例?已编辑我的答案以添加自定义详细信息。在生成存根时,必须使用-b选项来包含此选项。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<bindings 
xmlns="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
version="2.0">    
  <bindings schemaLocation="my.xsd" node="/xsd:schema">
     <bindings node="xsd:complexType[@name='MyObject']">
            <jaxb:property name="MyObjectNewName"/> 
     </bindings>
  </bindings>
</bindings>