嗨我必須從使用url和登錄參數和一些XML參數作爲輸入的網站獲取信息使用PHP。我是任何API調用的新手,請解釋我如何在我的PHP代碼中使用這些參數,並向服務器發出請求以獲取信息 當我在SOAP UI中使用這些參數時,我可以獲得演示結果,我需要在PHP中構建相同。調用REST API以使用URL和參數從網站檢索數據
https://transact-prelive.litle.com/vap/communicator/online
Username: u82917418420715660
Password: dENteSXnXwfqKHF
Merchant Id: 01183990
<litleOnlineRequest version="9.4" xmlns="http://www.litle.com/schema" merchantId="01183990">
<authentication>
<user>u82917418420715660</user>
<password>dENteSXnXwfqKHF</password>
</authentication>
<authorization id="834262" reportGroup="ABC Division" customerId="038945">
<orderId>65347567</orderId>
<amount>40000</amount>
<orderSource>3dsAuthenticated</orderSource>
<billToAddress>
<name>John Smith</name>
<addressLine1>100 Main St</addressLine1>
<city>Boston</city>
<state>MA</state>
<zip>12345</zip>
<email>[email protected]</email>
<phone>555-123-4567</phone>
</billToAddress>
<card>
<type>VI</type>
<number>4000000000000001</number>
<expDate>1209</expDate>
<cardValidationNum>555</cardValidationNum>
</card>
<cardholderAuthentication>
<authenticationValue></authenticationValue>
<authenticationTransactionId></authenticationTransactionId>
</cardholderAuthentication>
</authorization>
</litleOnlineRequest>
你可以使用php curl函數。看看 http://stackoverflow.com/questions/561816/php-curl-extract-an-xml-response –