here is my client code for soap-client
here is soap-server.php file
wsdl file for this
Code:
<?php
$uname = $_REQUEST['user'];
$passw = $_REQUEST['pass'];
$client = new SoapClient("http://192.168.0.128/nusoap/login.wsdl");
echo $client->Login($uname,$passw);
?>
Code:
<?php
function getCatalogEntry($uname,$passw)
{
$con=mysql_connect("192.168.0.128","root","admin");
mysql_select_db("auth",$con);
$res=mysql_query("select * from authorise where username='".$uname."' and password='".$passw."'");
if(mysql_num_rows($res)==0)
{
$a= "http://192.168.0.128/lo/index.html";
return ($a);
}
else
{
$s=1;
$row=mysql_fetch_array($res);
$r=$row['hyperlink'];
return ($r);
}
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("http://192.168.0.128/lo/catalog.wsdl");
$server->addFunction('getCatalogEntry');
$server->handle();
?>
wsdl file for this
Code:
<?xml version ='1.0' encoding ='UTF-8' ?>
<definitions name='Catalog'
targetNamespace='catalog'
xmlns:tns='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='uname' type='xsd:string'/>
<part name='passw' 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:catalog#getCatalogEntry'/>
<input>
<soap:body use='encoded' namespace='urn:catalog'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:catalog'
encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
</binding>
<service name='CatalogService'>
<port name='CatalogPort' binding='CatalogBinding'>
<soap:address location='http://192.168.0.128/lo/soap-server.php'/>
</port>
</service>
</definitions>
Comment