PHP : SOAP-ERROR: Parsing WSDL



我正在尝试使用SOAPCLIENT()访问SOAP API,但是我会遇到以下错误。

SoapFault Object
(
    [message:protected] => SOAP-ERROR: Parsing WSDL: No  element with name '10100/Processes/OrderView/OrderView_v1_0?wsdl'
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => C:xampphtdocsapisoapclient.php
    [line:protected] => 37
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => C:xampphtdocsapisoapclient.php
                    [line] => 37
                    [function] => SoapClient
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                        (
                            [0] => https://example.com:443/orders/v1/orderview?wsdl
                            [1] => Array
                                (
                                    [trace] => 1
                                    [stream_context] => Resource id #4
                                    [cache_wsdl] => 0
                                )
                        )
                )
        )
    [previous:Exception:private] => 
    [faultstring] => SOAP-ERROR: Parsing WSDL: No  element with name '10100/Processes/OrderView/OrderView_v1_0?wsdl'
    [faultcode] => WSDL
)

以下是我的代码:

$header = 'Authorization:'.$tokenType.' '.$accessToken;
$streamContext = array('http' => array("header" => $header , 'user_agent' => 'PHPSoapClient' ));
$streamContext['ssl'] = array(
    "verify_peer" => false,
    "verify_peer_name" => false,
    "allow_self_signed" => false
);
try{
    $client = new SoapClient('https://example.com:443/orders/v1/orderview?wsdl', array(
                                "trace" => 1,                
                                "stream_context" => stream_context_create($streamContext),
                                'cache_wsdl' => WSDL_CACHE_NONE
                            ));
    var_dump($client->__getFunctions());
    exit;

使用php_curl(),它可以正常工作并得到响应,但是在尝试与SoapClient连接时会出现错误。

c: xampp htdocs api soap soap client.php的第37行是什么?这可能不是问题所在的地方,但可能有助于了解错误消息。

当您从参数数组中删除stream_context参数时,它是否有效?

最新更新