[英]Can't access WSDL without valid SOAPaction
I'm trying to look at a WSDL response to get a list of actions but it always fails without a valid SOAPAction header. Setting SOAPAction to an empty string returns same error.我正在尝试查看 WSDL 响应以获取操作列表,但如果没有有效的 SOAPAction header,它总是会失败。将 SOAPAction 设置为空字符串会返回相同的错误。
Server did not recognize the value of HTTP Header SOAPAction: <some-value>
Using the content type optional value like so returns the same error:像这样使用内容类型可选值会返回相同的错误:
application/soap+xml; charset=utf-8; action=<some-value>
What is the proper order of operations to get the full WSDL response containing a valid set of actions?获得包含一组有效操作的完整 WSDL 响应的正确操作顺序是什么? Other requests fail with the same error despite using the documented action name.
尽管使用记录的操作名称,其他请求仍会失败并出现相同的错误。 Possibly it's listed differently in the WSDL
可能它在 WSDL 中列出的不同
If I make a POST request to the documented wsdl url https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2021-11-01
如果我向记录的 wsdl url
https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2021-11-01
发出 POST 请求
I get a document like:我得到这样的文件:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://thalesgroup.com/RTTI/2021-11-01/ldb/"
targetNamespace="http://thalesgroup.com/RTTI/2021-11-01/ldb/">
<wsdl:import namespace="http://thalesgroup.com/RTTI/2021-11-01/ldb/" location="rtti_2021-11-01_ldb.wsdl" />
<wsdl:service name="ldb">
<wsdl:port name="LDBServiceSoap" binding="tns:LDBServiceSoap">
<soap:address location="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb12.asmx" />
</wsdl:port>
<wsdl:port name="LDBServiceSoap12" binding="tns:LDBServiceSoap12">
<soap12:address location="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb12.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
If I then make a POST request to the listed service address https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb12.asmx
I get 401 unauthorised.如果我然后向列出的服务地址
https://lite.realtime.nationalrail.co.uk/OpenLDBWS/ldb12.asmx
发出 POST 请求,我得到 401 未授权。
I can then send a SOAP document containing the token I have for the service like然后我可以发送一个 SOAP 文档,其中包含我拥有的服务令牌,例如
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:service="http://thalesgroup.com/RTTI/2014-02-20/ldb/" xmlns:types="http://thalesgroup.com/RTTI/2010-11-01/ldb/commontypes">
<SOAP-ENV:Header>
<types:AccessToken>
<types:TokenValue>{{token}}</types:TokenValue>
</types:AccessToken>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
But then get a 500 internal server error:但随后得到 500 内部服务器错误:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
But no value I use as the SOAPAction
header returns anything other than Server did not recognize the value of HTTP Header SOAPAction: valuehere
.但是我没有使用任何值,因为
SOAPAction
header 返回除 Server 以外的任何Server did not recognize the value of HTTP Header SOAPAction: valuehere
。 Adding ?WSDL
to the url does nothing.添加
?WSDL
到 url 什么都不做。
For any future googlers: I found the proper wsdl at:对于任何未来的谷歌员工:我在以下位置找到了正确的 wsdl:
https://lite.realtime.nationalrail.co.uk/OpenLDBWS/rtti_2021-11-01_ldb.wsdl
That lists the actual SOAPAction values that I can use to get past that error.它列出了我可以用来克服该错误的实际 SOAPAction 值。
Now I just get even more unhelpful...现在我变得更加无助了......
<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Unexpected server error</soap:Text>
</soap:Reason>
<soap:Detail />
</soap:Fault>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.