Identifying reqesting client in server code

2009-04-21
2013-06-06
  • <style type="text/css">
    <!--
    .style5 {color: #FF0000}
    -->
    </style>
    <div align="justify"><strong>I have a question regarding a identifing the cleint by server. When
      I write a simple helloworld server and cleint codes all wsdl and other
      functions are working. But I want to identify the reqesting client in
      server code and respond (To set in return value in hellowold function)
    that client address back to cleint. Please help me to solve this.</strong></div>
    <p><em><strong>My nusoap.php in lib folder and all code in '<a href="http://localhost/services/">http://localhost/services/</a>'</strong></em></p>

    <pre wrap=""><strong>Cleint code:</strong></pre>
    <blockquote>
      <pre wrap="">
    <span class="style4">require_once('./lib/nusoap.php');
    $client = new  nusoap_client('<a href="http://localhost/services/server.php?wsdl">http://localhost/services/server.php?wsdl</a>', 'true');
    echo  $result = $client-&gt;call('helloworld');</span></pre>
    </blockquote>
    <p><em><strong>Server code: (server.php)</strong></em></p>
    <blockquote>
      <p><em>require_once('lib/nusoap.php');<br />
        $server = new soap_server();<br />
        $server-&gt;configureWSDL('hellowsdl','urn:hellowsdl');<br />
        <br />
        $server-&gt;register('helloworld', <br />
        </em><em>&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; array('name' = 'xsd:string'), <br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; array('return' = 'xsd:string'), <br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; 'urn:hellowsdl', <br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; 'urn:hellowsdl#hello', <br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; 'rpc', <br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; 'encoded', <br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; 'Says hello to the caller' <br />
        );<br />
        <br />
        function helloworld()<br />
        {<br />
        &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; return &quot;Hi, &quot;;<br />
        <span class="style5">&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;<strong> // I want to return requester(Client) address (Ip or url)
        here..................<br />
    &nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; // Return (This is your address.............)</strong></span>
        <br />
        }<br />
        $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)<br />
        $HTTP_RAW_POST_DATA : '';<br />
        $server-service($HTTP_RAW_POST_DATA);</em></p>
    </blockquote>
    <p></p>

     
    • Whithout HTML Tags........................

      I have a question regarding a identifing the cleint by server. When I write a simple helloworld server and cleint codes all wsdl and other functions are working. But I want to identify the reqesting client in server code and respond (To set in return value in hellowold function) that client address back to cleint. Please help me to solve this.

      My nusoap.php in lib folder and all code in 'http://localhost/services/'

      Cleint code:
      require_once('./lib/nusoap.php');
      $client = new  nusoap_client('http://localhost/services/server.php?wsdl', 'true');
      echo  $result = $client->call('helloworld');

      Server code: (server.php)

      require_once('lib/nusoap.php');
      $server = new soap_server();
      $server->configureWSDL('hellowsdl','urn:hellowsdl');

      $server->register('helloworld',
      array('name' = 'xsd:string'),
      array('return' = 'xsd:string'),
      'urn:hellowsdl',
      'urn:hellowsdl#hello',
      'rpc',
      'encoded',
      'Says hello to the caller'
      );

      function helloworld()
      {
      return "Hi, ";
      // I want to return requester(Client) address (Ip or url) here..................
      // Return (This is your address.............)
      }
      $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
      $HTTP_RAW_POST_DATA : '';
      $server-service($HTTP_RAW_POST_DATA);

       
    • Whithout HTML Tags........................

      I have a question regarding a identifing the cleint by server. When I write a simple helloworld server and cleint codes all wsdl and other functions are working. But I want to identify the reqesting client in server code and respond (To set in return value in hellowold function) that client address back to cleint. Please help me to solve this.

      My nusoap.php in lib folder and all code in 'http://localhost/services/'

      Cleint code:
      require_once('./lib/nusoap.php');
      $client = new  nusoap_client('http://localhost/services/server.php?wsdl', 'true');
      echo  $result = $client->call('helloworld');

      Server code: (server.php)

      require_once('lib/nusoap.php');
      $server = new soap_server();
      $server->configureWSDL('hellowsdl','urn:hellowsdl');

      $server->register('helloworld',
      array('name' = 'xsd:string'),
      array('return' = 'xsd:string'),
      'urn:hellowsdl',
      'urn:hellowsdl#hello',
      'rpc',
      'encoded',
      'Says hello to the caller'
      );

      function helloworld()
      {
      return "Hi, ";
      // I want to return requester(Client) address (Ip or url) here..................
      // Return (This is your address.............)
      }
      $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
      $HTTP_RAW_POST_DATA : '';
      $server-service($HTTP_RAW_POST_DATA);

       
    • Whithout HTML Tags........................

      I have a question regarding a identifing the cleint by server. When I write a simple helloworld server and cleint codes all wsdl and other functions are working. But I want to identify the reqesting client in server code and respond (To set in return value in hellowold function) that client address back to cleint. Please help me to solve this.

      My nusoap.php in lib folder and all code in 'http://localhost/services/'

      Cleint code:
      require_once('./lib/nusoap.php');
      $client = new  nusoap_client('http://localhost/services/server.php?wsdl', 'true');
      echo  $result = $client->call('helloworld');

      Server code: (server.php)

      require_once('lib/nusoap.php');
      $server = new soap_server();
      $server->configureWSDL('hellowsdl','urn:hellowsdl');

      $server->register('helloworld',
      array('name' = 'xsd:string'),
      array('return' = 'xsd:string'),
      'urn:hellowsdl',
      'urn:hellowsdl#hello',
      'rpc',
      'encoded',
      'Says hello to the caller'
      );

      function helloworld()
      {
      return "Hi, ";
      // I want to return requester(Client) address (Ip or url) here..................
      // Return (This is your address.............)
      }
      $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
      $HTTP_RAW_POST_DATA : '';
      $server-service($HTTP_RAW_POST_DATA);