如何在SOAP PHP中選擇端口?我正在開發一個TravelPort作爲GDS的旅遊預訂網站。 我剛剛開始研究他們的WSDL,我試圖用它們用PHP調用他們的服務器。我無法做到。我知道服務器是可以工作的,因爲如果我製作一個請求並通過cURL發送請求,我會得到我期待的響應,但是通過使用和調整他們自己的sample code(接受保密協議,然後單擊「示例代碼」以查看),我不會去任何地方。如何在php中指定端口名稱WSDL
通過查看SOAP PHP模塊生成的請求,我認爲問題在於它使用了錯誤的函數。我不認爲我可以透露整個WSDL,但這裏是摘錄:
<!-- Service -->
<service name="AirService">
<port name="AirRepriceSearchPort"
binding="tns:AirRepriceSearchBinding">
<soap:address
location="http://localhost:8080/kestrel/AirService" />
</port>
<port name="AirScheduleSearchPort"
binding="tns:AirScheduleSearchBinding">
<soap:address
location="http://localhost:8080/kestrel/AirService" />
</port>
<port name="AirLowFareSearchPort"
binding="tns:AirLowFareSearchBinding">
<soap:address
location="http://localhost:8080/kestrel/AirService" />
</port>
顯然劇本總是產生基於AirReprice模塊代替LowFareSearch模塊上的要求。事實上,如果我編輯WSDL並將「AirLowFareSearchPort」作爲第一個元素,則該請求將起作用。
我已經試過如下:
指定使用
$client->AirLowFareSearchPort($data)
採取什麼行動,但它不是一個有效的功能;我用
$client->__getfunctions()
得到了所有的功能:
:「服務」
[0]=>
string(48) "AirRepriceRsp service(AirRepriceReq $parameters)"
[1]=>
string(56) "ScheduleSearchRsp service(ScheduleSearchReq $parameters)"
[2]=>
string(54) "LowFareSearchRsp service(LowFareSearchReq $parameters)"
[3]=>
string(66) "LowFareSearchAsynchRsp service(LowFareSearchAsynchReq $parameters)"
它看起來像唯一的「功能」是,但我不明白,我會把東西放在括號內。
我沒有其他想法。希望你能幫助!
UPDATE:
我發現this article它暴露出的問題。但是,它引用了它們自己的模塊,稱爲PHP Web服務。我需要用SOAP做同樣的事情。我真的需要你的幫助..