PHP SoapClient无法处理重定向到https

时间:2016-02-19 09:11:40

标签: php soap https soap-client

我正在使用PHP SoapClient实现SOAP客户端。

wsdl-file指定http类型函数的URL(如http://api.example.com/a/b)。

然而,在被叫时,我得到了回复

HTTP/1.0 301 Moved Permanently
Location: https://api...

显然,SoapClient无法处理重定向。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:-1)

$param = array('user' => 'Gopal',
    'password' => 'Rathod',
    'KeyCode' => 'XYXXYGOPALASDADXXX',
    'ExternalID' => 'PUBLICSTORAGE',
    'sXml' => $strinXML, 'trace' => TRUE);

$soapClient = new SoapClient('https://wsdlfullUrl.asmx?WSDL', array('trace' => TRUE));
$result = $soapClient->__soapCall('Request', array($param));

echo '<br> 3. Call Request:<br>' .  $soapClient->__getLastRequest() ;
echo '<br> 4. RESPONSE:<br>' . $soapClient->__getLastResponse();


More link  http://php.net/manual/en/book.soap.php