首先,我刚刚开始研究 Web 服务,但我陷入了第一步,即从提供的 wsdl/xsd 创建 java 类。我正在运行以下 ant 任务来创建 java 类并将它们包装在给定位置的 jar 文件中。
错误 :
[xjc] [ERROR] s4s-elt-schema-ns: The namespace of element 'definitions' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
[xjc] line 2 of file:/Users/deblinakarmakar/Desktop/work/Wland/wonderland/hybris/bin/custom/wonderlandcore/resources/taxware/BatchTaxCalculationManagerService.wsdl
[xjc]
[xjc] [ERROR] s4s-elt-invalid: Element 'definitions' is not a valid element in a schema document.
[xjc] line 2 of file:/Users/deblinakarmakar/Desktop/work/Wland/wonderland/hybris/bin/custom/wonderlandcore/resources/taxware/BatchTaxCalculationManagerService.wsdl
这是我的 WSDL 文件:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ws.taxware.com/service" xmlns:wns="http://ws.taxware.com/service" xmlns:tns="http://ws.taxwareenterprise.com" xmlns:ens="http://ws.taxware.com/exception" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ws.taxwareenterprise.com" elementFormDefault="qualified">
<!-- This schema import is for the common complex types for both batch and tax. -->
<!-- PLEASE DO NOT OVVERRIDE THIS WSDL FILE WITH ANY COMMON COMPLEX TYPE USED BY BOTH TAX AND BATCH WSDLs -->
<import namespace="http://ws.taxwareenterprise.com" schemaLocation="TaxBatchCommon.xsd"/>
<import namespace="http://ws.taxwareenterprise.com" schemaLocation="BatchTaxCalculationTypes.xsd"/>
<xs:element name="batchCalculateDocumentRequest" type="tns:BatchTaxCalculationRequest"/>
<xs:element name="batchCalculateDocumentRequestResponse"/>
<xs:element name="cancelBatchRequestResponse"/>
<xs:element name="endBatchRequestResponse"/>
<xs:element name="cancelBatchRequest" type="tns:BatchIdRequest"/>
<xs:element name="endBatchRequest" type="tns:BatchIdRequest"/>
<xs:element name="removeBatchResultsRequest" type="tns:BatchIdRequest"/>
<xs:element name="getBatchExceptionsRequest" type="tns:BatchIdRangeRequest"/>
<xs:element name="getBatchExceptionsResponse" type="tns:ExceptionsResponse"/>
<xs:element name="getBatchResultsRequest" type="tns:BatchIdRangeRequest"/>
<xs:element name="getBatchResultsResponse" type="tns:GetBatchResultsResponse"/>
<xs:element name="getBatchSuccessCountRequest" type="tns:BatchIdRequest"/>
<xs:element name="getBatchSuccessCountResponse" type="tns:CountResponse"/>
<xs:element name="isBatchCompleteRequest" type="tns:BatchIdRequest"/>
<xs:element name="isBatchCompleteResponse" type="tns:IsBatchCompleteResponse"/>
<xs:element name="startBatchRequest" type="tns:StartBatchRequest"/>
<xs:element name="startBatchResponse" type="tns:BatchIdResponse"/>
</schema>
</wsdl:types>
<wsdl:message name="cbRequest">
<wsdl:part name="request" element="tns:cancelBatchRequest"/>
</wsdl:message>
<wsdl:message name="cbResponse">
<wsdl:part name="request" element="tns:cancelBatchRequestResponse"/>
</wsdl:message>
<wsdl:message name="ebRequest">
<wsdl:part name="request" element="tns:endBatchRequest"/>
</wsdl:message>
<wsdl:message name="ebResponse">
<wsdl:part name="request" element="tns:endBatchRequestResponse"/>
</wsdl:message>
<wsdl:message name="bcdRequest">
<wsdl:part name="request" element="tns:batchCalculateDocumentRequest"/>
</wsdl:message>
<wsdl:message name="bcdResponse">
<wsdl:part name="request" element="tns:batchCalculateDocumentRequestResponse"/>
</wsdl:message>
<wsdl:message name="gbeRequest">
<wsdl:part name="request" element="tns:getBatchExceptionsRequest"/>
</wsdl:message>
<wsdl:message name="gbeResponse">
<wsdl:part name="result" element="tns:getBatchExceptionsResponse"/>
</wsdl:message>
<wsdl:message name="gbrRequest">
<wsdl:part name="request" element="tns:getBatchResultsRequest"/>
</wsdl:message>
<wsdl:message name="gbrResponse">
<wsdl:part name="result" element="tns:getBatchResultsResponse"/>
</wsdl:message>
<wsdl:message name="gbscRequest">
<wsdl:part name="request" element="tns:getBatchSuccessCountRequest"/>
</wsdl:message>
<wsdl:message name="gbscResponse">
<wsdl:part name="result" element="tns:getBatchSuccessCountResponse"/>
</wsdl:message>
<wsdl:message name="ibcRequest">
<wsdl:part name="request" element="tns:isBatchCompleteRequest"/>
</wsdl:message>
<wsdl:message name="ibcResponse">
<wsdl:part name="result" element="tns:isBatchCompleteResponse"/>
</wsdl:message>
<wsdl:message name="rbrRequest">
<wsdl:part name="request" element="tns:removeBatchResultsRequest"/>
</wsdl:message>
<wsdl:message name="sbRequest">
<wsdl:part name="request" element="tns:startBatchRequest"/>
</wsdl:message>
<wsdl:message name="sbResponse">
<wsdl:part name="result" element="tns:startBatchResponse"/>
</wsdl:message>
<wsdl:message name="twFault">
<wsdl:part name="fault" element="tns:tweFault"/>
</wsdl:message>
<wsdl:portType name="BatchTaxCalculationManagerServiceInterface">
<wsdl:operation name="calculateDocument">
<wsdl:input message="wns:bcdRequest"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="cancelBatch">
<wsdl:input message="wns:cbRequest"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="endBatch">
<wsdl:input message="wns:ebRequest"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="getBatchExceptions">
<wsdl:input message="wns:gbeRequest"/>
<wsdl:output message="wns:gbeResponse"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="getBatchResults">
<wsdl:input message="wns:gbrRequest"/>
<wsdl:output message="wns:gbrResponse"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="getBatchSuccessCount">
<wsdl:input message="wns:gbscRequest"/>
<wsdl:output message="wns:gbscResponse"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="isBatchComplete">
<wsdl:input message="wns:ibcRequest"/>
<wsdl:output message="wns:ibcResponse"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="removeBatchResults">
<wsdl:input message="wns:rbrRequest"/>
<!--<wsdl:output message="wns:ibcResponse"/>-->
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
<wsdl:operation name="startBatch">
<wsdl:input message="wns:sbRequest"/>
<wsdl:output message="wns:sbResponse"/>
<wsdl:fault name="twFault" message="wns:twFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BatchTaxCalculationManagerServiceSoapBinding" type="wns:BatchTaxCalculationManagerServiceInterface">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="calculateDocument">
<soap:operation soapAction="http://ws.taxwareenterprise.com/calculateDocument" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="cancelBatch">
<soap:operation soapAction="http://ws.taxwareenterprise.com/cancelBatch" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="endBatch">
<soap:operation soapAction="http://ws.taxwareenterprise.com/endBatch" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getBatchExceptions">
<soap:operation soapAction="http://ws.taxwareenterprise.com/getBatchExceptions" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getBatchResults">
<soap:operation soapAction="http://ws.taxwareenterprise.com/getBatchResults" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getBatchSuccessCount">
<soap:operation soapAction="http://ws.taxwareenterprise.com/getBatchSuccessCount" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="isBatchComplete">
<soap:operation soapAction="http://ws.taxwareenterprise.com/isBatchComplete" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="removeBatchResults">
<soap:operation soapAction="http://ws.taxwareenterprise.com/removeBatchResults" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="startBatch">
<soap:operation soapAction="http://ws.taxwareenterprise.com/startBatch" style="document" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="twFault">
<soap:fault name="twFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BatchTaxCalculationManagerServiceService">
<wsdl:port name="BatchTaxCalculationManagerService" binding="wns:BatchTaxCalculationManagerServiceSoapBinding">
<soap:address location="http://localhost:8086/twe/services/BatchTaxCalculationManagerService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>