SoapFault:无法连接到主持人

时间:2016-09-02 17:23:15

标签: php soap soap-client

我在SOAP中创建一个web服务,接下来是

 $dataws=[
    'serie'=>$factura->serie,
    'folio'=>$factura->folio,
    'rfc'=>'xxxx123456',
    'key'=>'xxxx-xxxx-xxx-xxx-xxxxx'
    ];
    try {
    $url= 'https://portal3.xsa.com.mx/xsamanager/servicesb2b/CancelCFDIService?wsdl';              
    echo "<strong>url destino:<pre>";
    print_r ($url);
    echo "</pre></strong>";
        $client = new SoapClient(
            $url,
            array(
                'trace' => true,
                'exceptions' => true,
                'encoding' => 'UTF-8',
                'stream_context'=> stream_context_create(array('ssl'=> array(
                            'verify_peer'=>false,
                            'verify_peer_name'=>false, 
                            'allow_self_signed' => true //can fiddle with this one.
                                 )
                            )
                )
            )
        );
        echo "<strong>Funciones existentes</strong> <pre>";
        print_r ($client->__getFunctions());
        echo "</pre>";
        $response = $client->cancelaCFDI($dataws);

当调用函数$ client-&gt; __ getFunctions()时, 显示这个

  

Funciones existentes       排列       (           [0] =&gt; cancelaCFDIResponse cancelaCFDI(cancelaCFDI $ parameters)           [1] =&gt; mensajeResponse mensaje(mensaje $参数)       )

显示函数,但调用函数$ client-&gt; cancelaCFDI($ dataws)结果如下:

Whoops, looks like something went wrong.

1/1
SoapFault in FacturasController.php line 726:
Could not connect to host
in FacturasController.php line 726
at SoapClient->__doRequest('<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws.cancel.manager.xsa.tralix.com"><SOAP-ENV:Body><ns1:cancelaCFDI><ns1:serie>NUVEM</ns1:serie><ns1:folio>7</ns1:folio><ns1:key>b6769894-fef7-4c1c-9d60-176de99377c4</ns1:key></ns1:cancelaCFDI></SOAP-ENV:Body></SOAP-ENV:Envelope> ', 'http://10.10.10.41:8080/xsamanager/servicesb2b/CancelCFDIService/', '', '1', '0')
at SoapClient->__call('cancelaCFDI', array(array('serie' => 'NUVEM', 'folio' => '7', 'rfc' => 'NHI120830831', 'key' => 'b6769894-fef7-4c1c-9d60-176de99377c4'))) in FacturasController.php line 726
at SoapClient->cancelaCFDI(array('serie' => 'NUVEM', 'folio' => '7', 'rfc' => 'NHI120830831', 'key' => 'b6769894-fef7-4c1c-9d60-176de99377c4')) in FacturasController.php line 726

我使用php的SoapClient

0 个答案:

没有答案