jrthor2
11-20-2003, 07:34 AM
I am trying to make a webservice using nusoap and keep getting an error in my response that says "error in msg parsing: xml was empty, didn't parse! ". Can someone please help me. I have attached my server code. Below is my client code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
include "sitecommon.php";
include "dbconn.php";
include "config.php";
//include('nusoap-0.6.1/nusoap.php');
require_once('/home/prgjr1/public_html/ra-new/inc/nusoap.php');
$soapclient = new soapclient('http://rawebdev.rss.riteaid.com/prgjr1/ra-new/stores/locator/webservice.php');
?>
<?
$soapresults = $soapclient->call('find_stores',$zip);
//print_r($soapresults);
/* handle any SOAP faults. */
if ($soapclient->fault) {
echo " Error exist<br>";
echo "FAULT: <p>Code: {$soapclient->faultcode}<br />";
echo "String: {$soapclient->faultactor} <br>";
} else {
echo $soapresults;
}
//view soap message
//$soapclient->call('find_stores',$zip);
//echo("<pre>" . htmlentities($soapclient->request) .
//"</pre>");
print '<br>Request<xmp>'.str_replace('><', ">\n<", $soapclient->request).'</xmp>';
print 'Response<xmp>'.str_replace('><', ">\n<", $soapclient->response).'</xmp>';
?>
</body>
</html>
Here are the Request/Responses
Request
POST /prgjr1/ra-new/stores/locator/webservice.php HTTP/1.0
User-Agent: NuSOAP/0.6.6
Host: rawebdev.rss.riteaid.com
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 506
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body>
<ns1:find_stores xmlns:ns1="http://testuri.org">
</ns1:find_stores>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response
HTTP/1.1 500 Internal Server Error
Date: Thu, 20 Nov 2003 13:29:25 GMT
Server: Apache/1.3.26 Ben-SSL/1.48 (Unix) Debian GNU/Linux PHP/4.1.2
X-Powered-By: PHP/4.1.2
Status: 500 Internal Server Error
Content-Length: 673
Connection: close
Content-Type: text/xml; charset=ISO-8859-1
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>Server</faultcode>
<faultactor>error in msg parsing:
xml was empty, didn't parse!</faultactor>
<faultstring>
</faultstring>
<detail>
<soapVal xsi:type="xsd:string">
</soapVal>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
include "sitecommon.php";
include "dbconn.php";
include "config.php";
//include('nusoap-0.6.1/nusoap.php');
require_once('/home/prgjr1/public_html/ra-new/inc/nusoap.php');
$soapclient = new soapclient('http://rawebdev.rss.riteaid.com/prgjr1/ra-new/stores/locator/webservice.php');
?>
<?
$soapresults = $soapclient->call('find_stores',$zip);
//print_r($soapresults);
/* handle any SOAP faults. */
if ($soapclient->fault) {
echo " Error exist<br>";
echo "FAULT: <p>Code: {$soapclient->faultcode}<br />";
echo "String: {$soapclient->faultactor} <br>";
} else {
echo $soapresults;
}
//view soap message
//$soapclient->call('find_stores',$zip);
//echo("<pre>" . htmlentities($soapclient->request) .
//"</pre>");
print '<br>Request<xmp>'.str_replace('><', ">\n<", $soapclient->request).'</xmp>';
print 'Response<xmp>'.str_replace('><', ">\n<", $soapclient->response).'</xmp>';
?>
</body>
</html>
Here are the Request/Responses
Request
POST /prgjr1/ra-new/stores/locator/webservice.php HTTP/1.0
User-Agent: NuSOAP/0.6.6
Host: rawebdev.rss.riteaid.com
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 506
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body>
<ns1:find_stores xmlns:ns1="http://testuri.org">
</ns1:find_stores>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response
HTTP/1.1 500 Internal Server Error
Date: Thu, 20 Nov 2003 13:29:25 GMT
Server: Apache/1.3.26 Ben-SSL/1.48 (Unix) Debian GNU/Linux PHP/4.1.2
X-Powered-By: PHP/4.1.2
Status: 500 Internal Server Error
Content-Length: 673
Connection: close
Content-Type: text/xml; charset=ISO-8859-1
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>Server</faultcode>
<faultactor>error in msg parsing:
xml was empty, didn't parse!</faultactor>
<faultstring>
</faultstring>
<detail>
<soapVal xsi:type="xsd:string">
</soapVal>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>