How to consume php login soap webservice to VB.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sisu
    New Member
    • Feb 2010
    • 16

    How to consume php login soap webservice to VB.net

    here is my client code for soap-client
    Code:
    <?php
    
    $uname = $_REQUEST['user'];
    $passw = $_REQUEST['pass'];
    
    
    
    
     
     $client = new SoapClient("http://192.168.0.128/nusoap/login.wsdl");
     echo $client->Login($uname,$passw);
    
    
    ?>
    here is soap-server.php file
    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>
    Last edited by Atli; Mar 15 '10, 10:43 AM. Reason: Added [code] tags.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Do you have a question?

    Comment

    • sisu
      New Member
      • Feb 2010
      • 16

      #3
      when i try to consume php webservice in VB.Net ,this webservice function is not consuming in VB.NET

      Comment

      Working...