1
我正在嘗試在英國使用QAS Web服務進行郵政編碼查找。當我發佈我的請求XML時,它說「服務器無法識別HTTP Header SOAPAction:DoSearch的值。」無法從第三方Web服務獲得響應
當我刪除mMethod.setRequestHeader(「SOAPAction」,「/ DoSearch」);從我的SOAPClient收到的錯誤是 如果沒有有效的操作參數,則無法處理請求。請提供有效的肥皂行動。
到WSDL的鏈接是: https://ws.ondemand.qas.com/ProOnDemand/V3/ProOnDemandService.asmx?WSDL
我猜promlem的是,我不能夠設置在標題中的作用參數,但我沒有對如何做到這一點的任何線索,我那種卡住了。請幫忙。
而我試圖張貼請求XML是:
<?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"
xmlns:qas="http://www.qas.com/OnDemand_2011-03">
<soap:Header>
<qas:QAAuthentication>
<qas:Username>username</qas:Username>
<qas:Password>password</qas:Password>
</qas:QAAuthentication>
</soap:Header>
<soap:Body>
<QASearch RequestTag="Single Line postcode search"
xmlns:web="http://www.qas.com/OnDemand_2011_03">
<web:Country>GBR</web:Country>
<web:Engine Flatten="true ">Singleline</web:Engine>
<web:Layout>QADefault</web:Layout>
<web:Search>B168JR</web:Search>
</QASearch>
</soap:Body>
</soap:Envelope>
你能提供一個鏈接到WSDL嗎? – Michael 2012-04-19 20:26:32
我強烈懷疑這是因爲生成的客戶端類文件。我會建議重新生成它們並嘗試。 – kosa 2012-04-19 20:27:59
對不起,指向WSDL的鏈接是:https://ws.ondemand.qas.com/ProOnDemand/V3/ProOnDemandService.asmx?WSDL – 2012-04-19 20:46:46