WSDL文件上的JAX-WS错误:“错误解析组件's:schema'”

WSDL文件上的JAX-WS错误:“错误解析组件's:schema'”,第1张

WSDL文件上的JAX-WS错误:“错误解析组件's:schema'”

我通过在更新到jaxws-maven-plugin 2.2时将Vivek
Pandey的方法
调整为Maven
来解决了这个问题。我在此重申后代:

摘要

把这个XJB自定义文件(见下文),在默认绑定文件目录下,并设置wsimport的绑定,并http://www.w3.org/2001/XMLSchema.xsd。

XJB定制

上面提到的XML文件xsd.xjb的内容应该在默认的绑定文件目录中,如下所示(贷方为Kohsuke):

<?xml version="1.0" encoding="UTF-8"?><bindings xmlns="http://java.sun.com/xml/ns/jaxb"          xmlns:xsd="http://www.w3.org/2001/XMLSchema"          xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"          version="2.0">  <globalBindings>    <xjc:simple />  </globalBindings>  <bindings scd="~xsd:complexType">    <class name="ComplexTypeType"/>  </bindings>  <bindings scd="~xsd:simpleType">    <class name="SimpleTypeType"/>  </bindings>  <bindings scd="~xsd:group">    <class name="GroupType"/>  </bindings>  <bindings scd="~xsd:attributeGroup">    <class name="AttributeGroupType"/>  </bindings>  <bindings scd="~xsd:element">    <class name="ElementType"/>  </bindings>  <bindings scd="~xsd:attribute">    <class name="attributeType"/>  </bindings></bindings>
聚甲醛

这是我的POM文件的相关部分,并记录了更改:

<plugin>    <!-- CHANGE: updated groupId and version -->    <groupId>org.jvnet.jax-ws-commons</groupId>    <artifactId>jaxws-maven-plugin</artifactId>    <version>2.2</version>    <executions>        <execution>  <goals>     <goal>wsimport</goal> </goals> <configuration>     <!-- CHANGE: added args tag to bind http://www.w3.org/2001/XMLSchema.xsd -->     <args>         <arg>-b</arg><arg>http://www.w3.org/2001/XMLSchema.xsd</arg>     </args>     <wsdlFiles>         <wsdlFile>erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl</wsdlFile>     </wsdlFiles>     <wsdlLocation>http://erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl</wsdlLocation>     <staleFile>${project.build.directory}/jaxws/stale/Service.asmx.stale</staleFile>     <!-- CHANGE: added bindingFiles tag to bind XJB customization, located at the default binding files directory, MyProject/src/jaxws/xsd.xjb . -->     <bindingFiles>         <bindingFile>xsd.xjb</bindingFile>     </bindingFiles> </configuration> <id>wsimport-generate-egtestreportengine</id> <phase>generate-sources</phase>        </execution>    </executions>    <dependencies>        <dependency> <groupId>javax.xml</groupId> <artifactId>webservices-api</artifactId> <version>1.4</version>        </dependency>    </dependencies>    <configuration>        <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>        <xnocompile>true</xnocompile>        <verbose>true</verbose>        <extension>true</extension>        <catalog>${basedir}/src/jax-ws-catalog.xml</catalog>        <target>2.0</target>    </configuration></plugin>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5500874.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-12

发表评论

登录后才能评论

评论列表(0条)

保存