SOAP PHP fault parsing WSDL: failed to load external entity?

前端 未结 12 1849
耶瑟儿~
耶瑟儿~ 2020-11-27 05:37

I\'m trying to run a web service using PHP & SOAP, but all I\'m getting so far is this:

(SoapFault)[2] message which states: \'SOAP-ERROR: Parsing

12条回答
  •  时光取名叫无心
    2020-11-27 06:34

    If anyone has the same problem, one possible solution is to set the bindto stream context configuration parameter (assuming you're connecting from 11.22.33.44 to 55.66.77.88):

    $context = [
        'socket' => [
            'bindto' => '55.66.77.88'
        ]
    ];
    
    $options = [
        'soapVersion' => SOAP_1_1,
        'stream_context' => stream_context_create($context)
    ];
    
    $client = new Client('11.22.33.44', $options);
    

提交回复
热议问题