繁体   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