Today I was thinking of using soap to develop a related interface to call a cooperative company, but encountered this error. After a long period of troubleshooting, Google also looked for a long time, but are not the problems I encountered. However, I finally found it to be related to the size of the amount of data transmitted by SoapServer (I do not know if the description is appropriate). When I fetch 10 data from the database, I can easily use soapclient to get the data, but when I query 1000 data from the database, I get 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 full XML document can be displayed. Is there a relationship between the environment configuration of this server? I don't know much about soap, I'm just learning to sell it now. It is hoped that experienced predecessors can guide twos. Thank you so much!
Here is my program code:
Query ($strGetList); $results = Array (); $xmlString = "
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
--- Dividing line ---
'abcd', 'encoding' => 'UTF-8'));
$ server-> setClass ('person');
$ server-> handle ();
--- Dividing line ---
'http://192.168.1.126:102/server.php',
'uri' => 'abcd',
'encoding' => 'UTF-8',
));
$ s1 = $ soap-> __ soapCall ('getInfo', array ());
echo $ s1;
} catch (Exction $ e) {
echo $ e-> getMessage ();
}
Reply content:
Today I was thinking of using soap to develop a related interface to call a cooperative company, but encountered this error. After a long period of troubleshooting, Google also looked for a long time, but are not the problems I encountered. However, I finally found it to be related to the size of the amount of data transmitted by SoapServer (I do not know if the description is appropriate). When I fetch 10 data from the database, I can easily use soapclient to get the data, but when I query 1000 data from the database, I get 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 full XML document can be displayed. Is there a relationship between the environment configuration of this server? I don't know much about soap, I'm just learning to sell it now. It is hoped that experienced predecessors can guide twos. Thank you so much!
Here is my program code:
Query ($strGetList); $results = Array (); $xmlString = "
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
--- Dividing line ---
'abcd', 'encoding' => 'UTF-8'));
$ server-> setClass ('person');
$ server-> handle ();
--- Dividing line ---
'http://192.168.1.126:102/server.php',
'uri' => 'abcd',
'encoding' => 'UTF-8',
));
$ s1 = $ soap-> __ soapCall ('getInfo', array ());
echo $ s1;
} catch (Exction $ e) {
echo $ e-> getMessage ();
}
From SoapClient's exception "[Client] looks like we got no XML document" should be a response problem, so first of all is to see what the response message is, there are several scenarios to help you locate the problem:
- Simply, you can use SOAPUI to see if the response is really a problem? Are you not responding?
- Geek a little, homemade a mock client to check the response message, the ordinary SOAP protocol is not difficult, simply post a small XML HTTP protocol to the server on the line, the code should be within 20 lines
- I usually use a little bit, because soap is the HTTP transport protocol, so you can crawl the entire HTTP Response, check whether its content conforms to XML format. Crawl mode can be used tcpdump (Linux command line) or Httptracer (Java cross-platform, easy to use, my favorite)
- Direct point of view soapclient.php source code, I remember the words of the small volume, find the string "looks like we got no XML document", and then go back to the XML parsing that paragraph, Output the original content before parsing to see what's wrong with the response content
Do not use SOAP, send the interface to your data dump out to see. It is estimated that the network transmission of what the problem, the data is not captured, XML is incomplete, can not be resolved.
Did you solve the problem? Ask for guidance