我要開發一個SOAP客戶端,以及供應商給我這個規格:SOAP客戶端通過HTTPS使用SSL證書兩側
- 將通過IP使用HTTPS來transmited,並會被打包成XML適應XML方案的不同定義的文檔。
- 通信是同步的,第三方應該等待響應。
- 每個請求和響應都會被簽名。
我使用從PHP SoapClient類外,一切工作正常,除了當我嘗試使用我的私人密鑰來建立與服務器的通信:
Code: WSDL | Message: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://remoteserver/CustomerManagementService?wsdl' : failed to load external entity "https://remoteserver/CustomerManagementService?wsdl
然後我試圖創建一個.PEM文件,它包含了我的私有密鑰串聯起來我的證書,我在讀過:how to send SOAP request with SSL certificate in PHP?
但它仍然會返回一個錯誤:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://remoteserver:80/CustomerManager/proxy/CustomerManagementService?WSDL%2FGWTCommonResources%2Fwsdl%2FGWTCommonMessages' : failed to load external entity "http://remoteserver:80/CustomerManager/proxy/CustomerManagementService?WSDL%2FGWTCommonResources%2Fwsdl%2FGWTCommonMessages
我想知道是否有某種方法可以準確獲取PHP的soapClient類發送的原始數據。我必須在哪裏設置供應商的證書。
我已經嘗試使用「$ client - > __ getLastRequest()」,但我得到一個NULL。這是我的代碼:
$client = new anotherSoapClient($service, array(
'local_cert' => $pem,
'style' => SOAP_RPC,
'use' => SOAP_ENCODED,
'soap_version' => SOAP_1_2,
'authentication'=> SOAP_AUTHENTICATION_DIGEST,
'ssl' => array(
'ciphers'=> "SHA1",
'verify_peer' => false,
'allow_self_signed' => true
),
'https' => array(
'curl_verify_ssl_peer' => false,
'curl_verify_ssl_host' => false
),
'cache_wsdl' => WSDL_CACHE_NONE,
'cache_ttl' => 86400,
'trace' => true,
'exceptions' => true,
));
// Test connection
echo BR.'Functions: <pre>';var_dump($client->__getFunctions());echo '</pre>';
$XMLrequest = $client->prepareRequest($email);
$response = $client->__anotherRequest('getCustomerInfo', $XMLrequest);
echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
順便說一句,我用我的本地機器上的PHP 5.4.9和服務器有PHP 5.3.10和anotherSoapClient是誰擴展PHP SoapClient的類的類:PHP soapClient send custom XML