Phpsoap error "lookslikewegotnoXMLdocument"

Source: Internet
Author: User
This error is reported when you want to use the soap development interface to call a partner. I have been troubleshooting for a long time, and I have been searching for google for a long time, but none of them are my problems. However, my final error is related to the size of the data transmitted by the soapserver (I don't know if this description is correct... this error is reported when you want to use the soap development interface to call a partner. I have been troubleshooting for a long time, and I have been searching for google for a long time, but none of them are my problems. However, my final error found that it was related to the size of the data transmitted by the soapserver (I don't know if this description is appropriate ). When I retrieve 10 pieces of data from the database, it is easy to use soapclient to obtain the data, however, when I query 1000 pieces of data from the database, an error ("Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in ......")! If I run the person. class. php program directly, the complete xml document can be displayed. Will the environment configuration of this server be related? I don't know much about soap, and I just want to learn it now. Hope that experienced elders can give some advice. Thank you!
The following is my program code:

 Query ($ strGetList); $ results = array (); $ xmlString ="
 \ N "; $ xmlString. ="\ N "; while ($ rows = $ GLOBALS ['le']-> fetch_assoc () {$ results [] = $ rows ;} foreach ($ results as $ key => $ val) {$ xmlString. ="
  
   
\ N "; foreach ($ val as $ k = >$ v) {if (strlen ($ v)> 0) {$ v = htmlspecialchars ($ v); $ xmlString. ="
   
    
$ V
   \ N ";}}$ xmlString. ="
  \ N ";}$ xmlString. ="\ N "; return $ xmlString ;}// $ p = new person; // echo $ p-> getInfo (); // all data can be displayed in the tested xml --- split line ---
 'Abcd', 'encoding' => 'utf-8'); $ server-> setClass ('person '); $ server-> handle (); --- split line ---
 'Http: // 192.168.1.126: 102/server. php', 'url' => 'abcd', 'encoding' => 'utf-8',); $ s1 = $ soap->__ soapCall ('getinfo ', array (); echo $ s1;} catch (Exction $ e) {echo $ e-> getMessage ();}

Reply content:

This error is reported when you want to use the soap development interface to call a partner. I have been troubleshooting for a long time, and I have been searching for google for a long time, but none of them are my problems. However, my final error found that it was related to the size of the data transmitted by the soapserver (I don't know if this description is appropriate ). When I retrieve 10 pieces of data from the database, it is easy to use soapclient to obtain the data, however, when I query 1000 pieces of data from the database, an error ("Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in ......")! If I run the person. class. php program directly, the complete xml document can be displayed. Will the environment configuration of this server be related? I don't know much about soap, and I just want to learn it now. Hope that experienced elders can give some advice. Thank you!
The following is my program code:

 Query ($ strGetList); $ results = array (); $ xmlString ="
 \ N "; $ xmlString. ="\ N "; while ($ rows = $ GLOBALS ['le']-> fetch_assoc () {$ results [] = $ rows ;} foreach ($ results as $ key => $ val) {$ xmlString. ="
  
   
\ N "; foreach ($ val as $ k = >$ v) {if (strlen ($ v)> 0) {$ v = htmlspecialchars ($ v); $ xmlString. ="
   
    
$ V
   \ N ";}}$ xmlString. ="
  \ N ";}$ xmlString. ="\ N "; return $ xmlString ;}// $ p = new person; // echo $ p-> getInfo (); // all data can be displayed in the tested xml --- split line ---
 'Abcd', 'encoding' => 'utf-8'); $ server-> setClass ('person '); $ server-> handle (); --- split line ---
 'Http: // 192.168.1.126: 102/server. php', 'url' => 'abcd', 'encoding' => 'utf-8',); $ s1 = $ soap->__ soapCall ('getinfo ', array (); echo $ s1;} catch (Exction $ e) {echo $ e-> getMessage ();}

From the SoapClient exception "[Client] looks like we got no XML document", the response should be faulty. Therefore, the first thing to do is to view the Response Message, there are several solutions to help you locate the problem:

  1. Simply put, you can use SoapUI to check whether there is a real problem with the response? No response?
  2. Geek makes a simulation client to check the response message. The common SOAP protocol is not difficult. You only need to POST a small XML file to the Server using the HTTP protocol, and the amount of code should be within 20 lines.
  3. I usually use SOAP because it uses the HTTP transmission protocol. Therefore, you can capture the entire HTTP Response and check whether the content conforms to the XML format. Tcpdump (Linux Command Line) or HTTPTracer (Java cross-platform, easy to use, my favorite) can be used for crawling)
  4. Directly view the SoapClient. php source code. If I remember correctly, the Code volume is quite small. Search for the string "looks like we got no XML document" and find the XML parsing section, output the original content before parsing to check whether the response content has any problems.

Do not use soap to dump the data that the interface sends to you. It is estimated that there is something wrong with the output of the network, the data is not fully captured, the xml is incomplete, and it cannot be parsed.

Have you solved the problem? Guidance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.