无法在Eclipse中实现请求响应WSDL操作 [英] Can't implement solicit-response WSDL operation in Eclipse
问题描述
我正在编写WSDL文件,并且从Eclipse验证程序收到此错误:
I'm writing a WSDL file and I get this error from the Eclipse validator:
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">
元素中:
This is the WSDL source I wrote, the line where the Eclipse validator gives me the error is in the <operation name="bootstrap">
element:
<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
Here you can find the complete WSDL file: https://dl.dropboxusercontent.com/u/33459047/StackOverflow/Slave.wsdl
这是因为WS-I Profile仅支持端点可以支持的4种推荐原语中的2种(而solicit-response不是其中之一)?或只是一些我看不到的愚蠢错误(我已经浪费了很多时间寻找我可能的错误).有谁可以帮助我吗?预先谢谢你.
Is this because the WS-I Profile supports only 2 of the 4 recommended primitives that an endpoint can support (and solicit-response is not one of them)? Or it just some stupid error I can't see (I already wasted a lot of time looking for a possible mistake of mine). Can someone help me please? Thank you in advance.
推荐答案
由于缺少WS-I Profile中操作请求响应的实现,我通过将操作类型更改为请求响应来解决了.
I solved by changing the operation type to request-response because of the missing implementation of the operation solicit-response in WS-I Profile.
更多详细信息,请参见在这里,感谢波格丹.
More details can be found here, thanks to Bogdan.
这篇关于无法在Eclipse中实现请求响应WSDL操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!