Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.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
Jaxb 要解析的JAXWS wsimport目录;“元素”;已定义错误_Jaxb_Jax Ws_Xjc_Catalog_Wsimport - Fatal编程技术网

Jaxb 要解析的JAXWS wsimport目录;“元素”;已定义错误

Jaxb 要解析的JAXWS wsimport目录;“元素”;已定义错误,jaxb,jax-ws,xjc,catalog,wsimport,Jaxb,Jax Ws,Xjc,Catalog,Wsimport,我们正在尝试使用由第三方托管的web服务。当我试图使用wsimport生成artifacts&JAXB类时,遇到了以下错误。 请注意,两个xsd文件内容完全相似(不确定为什么会这样做),包括名称空间。然而 最后一部分servdocoid是不同的。wsdl和模式的结构如下 [ERROR] 'ElementX' is already defined line # of http:/....:port/wsdl/schema1.xsd?serviceoid=123&servdocoid=&

我们正在尝试使用由第三方托管的web服务。当我试图使用wsimport生成artifacts&JAXB类时,遇到了以下错误。 请注意,两个xsd文件内容完全相似(不确定为什么会这样做),包括名称空间。然而 最后一部分servdocoid是不同的。wsdl和模式的结构如下

[ERROR] 'ElementX' is already defined
  line # of http:/....:port/wsdl/schema1.xsd?serviceoid=123&servdocoid=<b>5</b>

[ERROR] (related to above error) the first definition appears here
  line # of http:/....:port/wsdl/schema1.xsd?serviceoid=123&servdocoid=<b>1</b>
[ERROR]“ElementX”已定义
http://..:port/wsdl/schema1.xsd的第#行?serviceoid=123&servdocoid=5
[错误](与上述错误相关)第一个定义出现在此处
http://:port/wsdl/schema1.xsd的第#行?serviceoid=123&servdocoid=1
我想我知道问题是什么,我正试图找到一个解决办法,在wsimport中使用`-catalog(不确定这样做是否正确),但仍然会出错

wsdl结构如前所述,我只突出显示了关键部分,而忽略了其余部分 wsdl定义的定义

<wsdl:definitions targetNamespace="http:/xyz.com" xmlns:soap12="http:/schemas.xmlsoap.org/wsdl/soap12/ xmlns:wsdl="http:/schemas.xmlsoap.org/wsdl/" xmlns:xsd="http:/www.w3.org/2001/XMLSchema">
...
<!-- relevant -->
<xsd:schema targetNamespace="http://schema1" xmlns:wsdl="http:/schemas.xmlsoap.org/wsdl/" xmlns:xsd="http:/www.w3.org/2001/XMLSchema xmlns:soap12="http:/schemas.xmlsoap.org/wsdl/soap12/>
  <xsd:include schemaLocation="http:/domain.com:port/wsdl/schema1.xsd?serviceoid=123&servdocoid=1" />
</xsd:schema>
...............
</wsdl:definitions>

wsimport使用了-catalog选项。如果遇到类似问题,请检查目录文件。我的目录文件有一个输入错误,wsimport忽略了目录文件中的xml解析错误。我可以看到wsimport开始在本地使用xsd,而不是在远程位置使用xsd。但是,我仍然遇到与以前相同的问题,但这次使用的是本地xsd。[ERROR]“ElementX”已经在文件的第#行定义:/c:/wsdl/app.xsd[ERROR](与上述错误相关)第一个定义出现在这里文件的第#行:/c:/wsdl/app.xsd
<xsd:schema elementFormDefault="qualified" targetNamespace="http:/schema1" xmlns:tns1="http:/schema1" xmlns:tns2="http:/schema2" xmlns:tns3="http:/schema3" xmlns:xsd="http:/www.w3.org/2001/XMLSchema">
....
<!-- relevant -->
<xsd:import namespace="http:/schema2" schemaLocation="http:/domain.com:port/wsdl/schema2.xsd?serviceoid=123&servdocoid=2" /> 
  <xsd:import namespace="http://schema3" schemaLocation="http:/domain.com:port/wsdl/schema3.xsd?serviceoid=123&servdocoid=3" /> 
...
</xsd:schema>
<xsd:schema elementFormDefault="qualified" targetNamespace="http:/schema2" xmlns:tns2="http:/schema2" xmlns:tns4="http://schema4"  xmlns:xsd="http:/www.w3.org/2001/XMLSchema">
...
<!-- relevant -->
 <xsd:import namespace="http:/schema4" schemaLocation="http:/domain.com:port/wsdl/schema4.xsd?serviceoid=123&servdocoid=4" /> 
...
</xsd:schema>
<xsd:schema elementFormDefault="qualified" targetNamespace="http:/schema4" xmlns:tns4="http:/schema2" xmlns:tns1="http:/schema1"  xmlns:xsd="http:/www.w3.org/2001/XMLSchema">
...
<!-- relevant -->
 <xsd:import namespace="http:/schema1" schemaLocation="http:/domain.com:port/wsdl/schema1.xsd?serviceoid=123&servdocoid=5" /> 
...
</xsd:schema>