SOAP: looks like we got no XML document

前端 未结 10 1414
日久生厌
日久生厌 2021-01-11 11:41

I\'m trying to create a web service but before I do I\'m trying to get a simple example that I found on the internet to work first but I keep getting the following error:

10条回答
  •  不思量自难忘°
    2021-01-11 11:59

    As far as I understand, the error of the SOAP parser when it comes invalid XML.

    As it was with me.

    1. Turn on the display of the error
    2. performed in try-catch and in the catch call __getLastResponse
    3. I catch another error:

    Warning: simplexml_load_string(): Entity: line 1: parser error : xmlParseCharRef: invalid xmlChar value 26 in

    1. The first patient was PHP5.3. Once run the script on the PHP5.4, became more informative error - I swear on an invalid character, because of which, presumably, and fell SOAP parser.

    As a result, I obtained the following code:

    $params = array(...);
    try
    {
        $response = $client->method( $params );
    }
    catch(SoapFault $e)
    {
        $response = $client->__getLastResponse();
        $response = str_replace("",'',$response); ///My Invalid Symbol
        $response = str_ireplace(array('SOAP-ENV:','SOAP:'),'',$response);
        $response = simplexml_load_string($response);
    }
    

    If someone will tell in the comments what a symbol, I will be grateful.

提交回复
热议问题