Jump to content

web service problem


nadman123

Recommended Posts

hello guyz...

this is the code of TypeWS.php

 

<?php
  // Pull in the NuSOAP code
  require_once('nusoap.php');

  // create SOAP server object
  $server = new soap_server();

  // Define the method as a PHP function
  function getTypes()
  {
    include("connection.php");
    $conn = oci_connect($UName, $PWord, $DB);
    $query="SELECT * FROM type";
    $stmt = oci_parse($conn, $query);
    oci_execute($stmt);
    
oci_fetch_all($stmt, $rows, 0, 0,OCI_FETCHSTATEMENT_BY_ROW);


    oci_free_statement($stmt);
    oci_close($conn);

    
return $rows;

  }
  
  // register function
  
$server->register('getTypes');

  $server->service(file_get_contents("php://input"));
?>

 

 

 

and this the code of the file TypeWSClient.php

 

<?php
  require_once('nusoap.php');
  // Create the client instance
  $client = new soapclient('TypeWS.php');

  $result = $client->call('getTypes');
  
  
$err = $client->getError(); 
     if ($err) 
     {  
       echo '<p><b>error: ' . $err . '</b></p>'; 
     }

  else
  {
    
print_r($result);

    echo "<p />";
?>
    <table border="1" align="center">
    <tr>
      <th>Type ID</th>
      <th>Type Name</th>
      </tr>
<?php
    
foreach($result as $Row) { echo "<tr>"; foreach($Row as $Data) { echo "<td>".$Data."</td>"; } echo "</tr>"; }

    echo "</table>";
  }
?>

 

when run the page on ma browser i get this messege

error: no transport found, or selected transport is not yet supported!

 

I m not really sure how to install the NUSOAP libraries..unless just download it an extract all the files to the server directory..

Please help me out guyz..

Thanks in advance..

Link to comment
https://forums.phpfreaks.com/topic/125883-web-service-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.