简体   繁体   中英

Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error

I'm trying to send test message with my PHP SOAP client. I'm using BeSimpleSoap library because I had problems with standard PHP SOAP calss and NuSOAP class. Part of the scriptis is:

        $client = new BeSimple\SoapClient\SoapClient("GSBService.wsdl", array( 
                        "trace"=>1,
                        "exceptions"=>1,
                        'location'=>$SERVICE_TEST,
                        "local_cert" =>$SOAP_cert,
                        'uri'=>$NAMESPACE_URI,
                        "passphrase"=>$cert_password,
                            "connection_timeout" => 60));

        var_dump($client->echo('abc1234'));
        print_r( $client->sendMessage($par_envelope));



        echo "<p>Request :".htmlspecialchars($client->__getLastRequest()) ."</p>";
        echo "<p>Response:".htmlspecialchars($client->__getLastResponse())."</p>";
        echo "<p>Debug:".soapDebug($client)."</p>";

Error is:

    string(57) "Request: 'abc1234'. Response: '2014-02-12T09:39:56.474Z'."
Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error in C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php:146 Stack trace: #0 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(146): SoapClient->__call('sendMessage', Array) #1 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(146): BeSimple\SoapClient\SoapClient->sendMessage(Array) #2 {main} thrown in C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php on line 146

I tried:

ini_set('soap.wsdl_cache_enabled',0);

and got this:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'file:///schema/GSBSchema.xsd' in C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php:113 Stack trace: #0 C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php(113): SoapClient->SoapClient('\wsdl_9429a1dff...', Array) #1 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(134): BeSimple\SoapClient\SoapClient->__construct('GSBService.wsdl', Array) #2 {main} thrown in C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php on line 113

The problem was in encoding of $par_envelope . After I encoded string in UTF-8 with utf8_encode I didn't get Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM