Hi Folks,
Can Anybody help me to figure out why the Webservice is not being able to return more than 40 records Aprox?
I am writing this for a GROWING TABLE, which has twenty thousand records presently.
Is there any Size LIMIT for RESPONSE??
Thanks in Advance
SUNJIB MOHANTY
My Code:
soap-client.php
<?php
$client = new SoapClient("catalog.wsdl");
$catalogid=$_GET['catalogid'];
$response = $client->getCatalogEntry($catalogid);
//echo $response;
?>
soap-server.php
<?php
function getCatalogEntry($catalogid)
{
if($catalogid=='3')
{
if(!$dbconnect = mysql_connect('localhost', 'root', 'pass'))
{
echo "Connection failed to the host 'localhost'.";
exit;
} // if
if (!mysql_select_db('test')) {
echo "Cannot connect to database 'test'";
exit;
} // if
else
{
$table_id = 'antibody';
$query = "SELECT * FROM antibody";
$dbresult = mysql_query($query, $dbconnect);
// create a new XML document
$doc = new DomDocument('1.0');
//echo "XML Dome is created";
// create root node
$root = $doc->createElement('root');
$root = $doc->appendChild($root);
while($row = mysql_fetch_array($dbresult, MYSQL_ASSOC))
{
$occ = $doc->createElement($table_id);
$occ = $root->appendChild($occ);
// add a child node for each field
foreach ($row as $fieldname => $fieldvalue)
{
$child = $doc->createElement($fieldname);
$child = $occ->appendChild($child);
$value = $doc->createTextNode($fieldvalue);
$value = $child->appendChild($value);
} // foreach
}
// get completed xml document
$xml_string = $doc->saveXML();
}
return $xml_string;
}
}
//ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("catalog.wsdl");
$server->addFunction("getCatalogEntry");
$server->handle();
?>
catalog.wsdl
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='Catalog'
targetNamespace='http://example.org/catalog'
xmlns:tns=' http://example.org/catalog '
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
<message name='getCatalogRequest'>
<part name='catalogId' type='xsd:string'/>
</message>
<message name='getCatalogResponse'>
<part name='Result' type='xsd:string'/>
</message>
<portType name='CatalogPortType'>
<operation name='getCatalogEntry'>
<input message='tns:getCatalogRequest'/>
<output message='tns:getCatalogResponse'/>
</operation>
</portType>
<binding name='CatalogBinding' type='tns:CatalogPortType'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='getCatalogEntry'>
<soap:operation soapAction='urn:localhost-catalog#getCatalogEntry'/>
<input>
<soap:body use='encoded' namespace='urn:localhost-catalog' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:localhost-catalog' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='CatalogService'>
<port name='CatalogPort' binding='CatalogBinding'>
<soap:address location='http://localhost/soap-server.php'/>
</port>
</service>
</definitions>