我正在尝试向 Loqate 服务发送 SOAP 请求,然后在 here.
找到他们的 API 文档文档说 SOAP 端点是
https://api.addressy.com/Capture/Interactive/Find/v1.1/wsdlnew.ws
样品要求是:
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Find
xmlns="http://api.addressy.com/">
<Key>AA11-AA11-AA11-AA11</Key>
<Text>wr5 3da</Text>
<IsMiddleware>True</IsMiddleware>
<Container>GB|RM|ENG|3DA-WR5</Container>
<Origin>52.182,-2.222</Origin>
<Countries>GB,US,CA</Countries>
<Limit>10</Limit>
<Language />
<Bias />
<Filters />
<GeoFence />
</Find>
</soap:Body>
</soap:Envelope>
所以我加载 Postman 并按照他们 blog 中的 Postman 指南执行这些步骤。
当我发送请求时,我只是返回这个页面。我不确定为什么它不起作用。
如何向该 API 发出 SOAP 请求?我错过了什么?
那不是服务端点,它是您可以获得 WSDL 的地址。在该 WSDL 中,您将找到服务端点:
<soap:address location="http://services.postcodeanywhere.co.uk/Capture/Interactive/Find/v1.10/soapnew.ws"/>
在那里发送您的请求。端点通过 http,但 https 似乎在同一地址上工作:https://services.postcodeanywhere.co.uk/Capture/Interactive/Find/v1.10/soapnew.ws
另一件事。如果你想要一个比 Postman 更具体的客户端,你可以试试 SoapUI。
你会尝试在肥皂体内使用 CDATA,比如
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Find xmlns="http://api.addressy.com/">
<![CDATA[
<Key>AA11-AA11-AA11-AA11</Key>
<Text>wr5 3da</Text>
<IsMiddleware>True</IsMiddleware>
<Container>GB|RM|ENG|3DA-WR5</Container>
<Origin>52.182,-2.222</Origin>
<Countries>GB,US,CA</Countries>
<Limit>10</Limit>
<Language />
<Bias />
<Filters />
<GeoFence />
]]>
</Find>
</soap:Body>
</soap:Envelope>
https://www.soapui.org/docs/functional-testing/working-with-cdata/