繁体   English   中英

wsimport错误:找不到xml类型

[英]wsimport error : xml type not found

我正在尝试使用wsimport <>从WSDL文件生成客户端构件,如下所述。 下面提到了WSDL文件和错误消息。 wsimport无法解析名称空间-tns,但它与wsdl的目标名称空间相同。 尝试使用目录文件和绑定文件进行编译,但是没有任何效果。 目前尚不清楚为什么tns名称空间与目标名称空间相同时为什么无法解析。 任何帮助将不胜感激。 谢谢 。

WSDL文件

<?xml version='1.0' encoding='UTF-8'?>
<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt). --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt). -->
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.statementprofile.billing.aosoft.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.statementprofile.billing.aosoft.com/" name="StatementprofileWebservice">
<message name="getSIRIStatementprofile">
<part name="StatementprofileRequestBean" type="tns:statementprofileRequest" />
</message>
<message name="getSIRIStatementprofileResponse">
<part name="return" type="tns:StatementprofileResponse" />
</message>
<portType name="StatementprofileWebservice">
<operation name="getSIRIStatementprofile">
<input message="tns:getSIRIStatementprofile" />
<output message="tns:getSIRIStatementprofileResponse" />
</operation>
</portType>
<binding name="StatementprofileWebservicePortBinding" type="tns:StatementprofileWebservice">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<operation name="getSIRIStatementprofile">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="http://webservice.statementprofile.billing.aosoft.com/" />
</input>
<output>
<soap:body use="literal" namespace="http://webservice.statementprofile.billing.aosoft.com/" />
</output>
</operation>
</binding>
<service name="StatementprofileWebservice">
<port name="StatementprofileWebservicePort" binding="tns:StatementprofileWebservicePortBinding">
<soap:address location="https://webdev.ams1907.com:443/Statementprofile/StatementprofileWebservice" />
</port>
</service>
</definitions>

D:\bea3\jdk160_05\bin>wsimport StatementProfile.wsdl
parsing WSDL...

错误

[ERROR] XML type "{http://webservice.statementprofile.billing.ups.com/}statementprofileRequest" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part "StatementprofileRequestBean" in the wsdl:message "{http://webservice.statementprofile.billing.aosoft.com/}getSIRIStatementprofile".
  line 5 of file:/D:/bea3/jdk160_05/bin/StatementProfile.wsdl

尝试使用此绑定文件

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer=" system"> 
    < system systemId="http://mahapps.inside.ups.com/AccountProfile/AccountProfileWebservice?wsdl" uri="AccountProfileWebservice.wsdl"/> 
</catalog> 

**Tried using binding file**

<bindings
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://webservice.accountprofile.billing.ups.com/"
    wsdlLocation="http://mahapps.inside.ups.com/AccountProfile/AccountProfileWebservice?wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws">
        <package name="com.test">

        </package>
    </bindings>

您的<types>元素在哪里? 它应包含您的过程所抱怨的类型的XSD声明。 您的WSDL要么有一个import某处导入XSD类型声明:

<types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
        <import namespace="http://webservice.statementprofile.billing.aosoft.com/" schemaLocation="your-schema.xsd" />             
    </schema>
</types>

嵌入<types>元素中的XSD:

<types>
    <xsd:schema elementFormDefault="qualified" xmlns="http://webservice.statementprofile.billing.aosoft.com/" targetNamespace="http://webservice.statementprofile.billing.aosoft.com/"> 
        <xsd:complexType name="statementprofileRequest">
            ...
        </xsd:complexType>
        <xsd:complexType name="StatementprofileResponse">
            ...
        </xsd:complexType>
    </xsd:schema>
</types>

或通过其他方式(例如通过绑定)向wsimport应用提供信息,但是如果您可以插入<types>信息,则应该能够进行验证。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM