0
我正在寫一個WSDL文件執行要求響應WSDL操作,我從Eclipse驗證此錯誤:不能在Eclipse
cvc-complex-type.2.4.a: Invalid content was found starting with element 'input'.
One of '{"http://schemas.xmlsoap.org/wsdl/":fault}' is expected.
這是我寫的WSDL源,所在行的Eclipse的驗證給我的錯誤是在<operation name="bootstrap">
元素:
<definitions name="Slave"
targetNamespace="http://pad.polito.it/ACSAuth"
xmlns:tns="http://pad.polito.it/ACSAuth"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="http://pad.polito.it/ACSAuth"
xmlns:tns="http://pad.polito.it/ACSAuth">
<xs:element name="isAuthQuery" type="tns:authRequestType" />
<!-- OMITTED COMPLEX TYPE authRequestType -->
<xs:element name="isAuthReply" type="tns:authReplyType" />
<!-- OMITTED COMPLEX TYPE authReplyType -->
<xs:element name="isAuthError" type="xs:string" />
<xs:element name="newSlave" type="tns:requestNewDB"/>
<!-- OMITTED COMPLEX TYPE requestNewDB -->
<xs:element name="errorBoot" type="xs:string" />
<xs:element name="AccessDB" type="tns:AccessDBType">
<!-- OMITTED COMPLEX TYPE AccessDBType -->
<xs:element name="passThrough" type="tns:passThroughType"/>
<!-- OMITTED COMPLEX TYPE passThroughType -->
</xs:schema>
</types>
<message name="askForAuth">
<part name="query" element="tns:isAuthQuery"/>
</message>
<message name="replyForAuth">
<part name="response" element="tns:isAuthReply"/>
</message>
<message name="errorForAuth">
<part name="error" element="tns:isAuthError"/>
</message>
<message name="newSlave">
<part name="newSlaveInfo" element="tns:newSlave"/>
</message>
<message name="updatedDB">
<part name="db" element="tns:AccessDB"/>
</message>
<message name="errorBoot">
<part name="error" element="tns:errorBoot"/>
</message>
<message name="passThroughNotice">
<part name="info" element="tns:passThrough"/>
</message>
<portType name="myPorts">
<operation name="isAuthorized">
<input message="tns:askForAuth"/>
<output message="tns:replyForAuth"/>
<fault name="error" message="tns:errorForAuth"/>
</operation>
<operation name="bootstrap">
<output name="newSlave" message="tns:newSlave"/>
<input name="newDB" message="tns:updatedDB"/>
<fault name="error" message="tns:errorBoot"/>
</operation>
<operation name="updateManager">
<input name="newUpdate" message="tns:updatedDB"/>
</operation>
<operation name="getNotice">
<input name="newNotice" message="tns:passThroughNotice"/>
</operation>
</portType>
<binding name="myBindings" type="tns:myPorts">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="isAuthorized">
<soap:operation soapAction="" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="error">
<soap:fault name="error" use="literal"/>
</fault>
</operation>
<operation name="bootstrap">
<soap:operation soapAction="" />
<output>
<soap:body use="literal"/>
</output>
<!-- *** THIS IS THE LINE WHERE I GET THE ERROR *** -->
<input>
<soap:body use="literal"/>
</input>
<fault name="error">
<soap:fault name="error" use="literal"/>
</fault>
</operation>
<operation name="updateManager">
<soap:operation soapAction="" />
<input>
<soap:body use="literal"/>
</input>
</operation>
<operation name="getNotice">
<soap:operation soapAction="" />
<input>
<soap:body use="literal"/>
</input>
</operation>
</binding>
<service name="MyServices">
<port name="ACSAuth" binding="tns:myBindings">
<soap:address location="http://localhost:8181/ACSAuth"/>
</port>
</service>
</definitions>
在這裏你可以找到完整的WSDL文件:https://dl.dropboxusercontent.com/u/33459047/StackOverflow/Slave.wsdl
這是因爲WS-I配置文件僅支持端點可以支持的4個推薦原語中的2個(並且請求響應不是其中之一)?或者它只是我看不到的一個愚蠢的錯誤(我已經浪費了很多時間尋找我的一個可能的錯誤)。 有人可以幫我嗎?先謝謝你。
我將在執行'wsdl2java -d測試your.wsdl'時得到以下錯誤信息:'WSDLToJava錯誤:非唯一身體部位!在一個港口,運營必須在線路上有唯一的操作簽名才能成功分派。在端口{http://pad.politio.it/ACSAuth}ACSAuth,操作「{http://pad.polito.it/ACSAuth}updateManager」和「{http://pad.polito.it/ACSAuth}bootstrap 「具有相同的請求體塊{http://pad.polito.it/ACSAuth} AccessDB' –