簡體   English   中英

PHP SoapClient無法使用代理訪問Web服務

[英]PHP SoapClient unable to access webservice using proxy

在PHP中使用SoapClient,遇到了一個我無法找到解決方案的問題。

我正在使用wsdl文件的本地副本,並且正在使用此設置:

$this->client = new \SoapClient(__DIR__ . '/../../some.wsdl',
                        array(
                                'proxy_host'    => $ip,
                                'proxy_port'    => $port,
                                'trace' => 1,
                                'exceptions' => true,
                                'cache_wsdl' => WSDL_CACHE_NONE
                        )
                    );

調用時出現錯誤:“禁止”:

$this->client->__call($method, $params)

我嘗試調用__getFunctions()

$this->client->__getFunctions() 

給出了我的WSDL文件中所有功能的列表。

我想念什么嗎?

像這樣調試代碼:

<?php 
    try{
            $client = new SoapClient($wsdl, $params);
            $out = $client;
        }catch(Exception $e){
            $out =  array('error' => $e,  'libxml' => libxml_get_last_error());
        }catch(SoapFault $s){
            $out = array('error' => $s, 'libxml' => libxml_get_last_error());
        }
    var_dump($out);
    exit();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM