SOAP Client not displaying the required response

  html, php, soap, web-services, wsdl

In my form, the code should be fetching the data from a specific field in the form (num_of_cups). My server page is working well, generating my wsdl. However, the client page is blank. Server side is supposed to calculate the total by fetching the ‘num_of_cups’ from the form and multiplying it with 60. Thus, should display the total on the client side page.
Someone please helpp!! Its really urgent for my assignment that I need to submit tomorrow.

Here is my client side of the SOAP service (client.php) code :


require_once "nusoap/lib/nusoap.php";

      //instatiate client with webservice
        $client = new nusoap_client("");

        //getting error constructor
        $error = $client->getError();

        //check for constructor error
        if ($error){

            echo "<h2>Constructor Error </h2> <pre>" . $error . "</pre>";

          //capture values from form
          if (isset($_GET['num_of_cups'])){
          //call function from server with parameters
          $response = $client -> call("getTotal",array("num_of_cups"=>$num_of_cups));

          //check for fault
          if ($client->fault){

                echo "<h2>Fault </h2>" . print_r($response) . "</pre>";


                //get error
                $error = $client->getError();

                //check for error
                if ($error){

                    echo "<h2>Error </h2> <pre>" . $error . "</pre>";


                    echo "<center>" . $response . "</center>";

Below is my server side of the SOAP service (calculateserver.php) :


//require nusoap library
require_once "nusoap/lib/nusoap.php";

//function to calculate total and get total price message
function getTotal($num_of_cups){

     //calculating total
     echo $num_of_cups;
     $total = (60*$num_of_cups);

     //set initial response message to display total
     $message="<h5>Your Total is : ".$total."</h5><br/>";

     return $message;


 //instantiate server
$server=new soap_server();

//configure wsdl

//register function
   array("num_of_cups" => "xsd:decimal"),

   array('return' => 'xsd:decimal'),



Below is my html page for the form :

     <meta charset="UTF-8"/>
    <link rel="stylesheet" href=""
          type="text/css" media="all"/>
    <link rel="stylesheet" href=";ver=4.9.8"
          type="text/css" media="screen"/>
      <link rel="stylesheet" href="zorbet.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="print.css" type="text/css" media="print"/>

<title>Pass to comann form!</title>


    <h2 style="text-align: center; color: orange;">Pass to comann: </h2>
    <table boder="0" width="1000">
    <form method = "GET" action ="totalclient.php">
        Full Name : <input type = "text" name="full_name"></br></td></tr>
        Flavour : <input type="text" name="flavour"></br></td></tr>
        Number of cups(qty) : <input type="Number" name = "num_of_cups"></br></td></tr>
        Address <input type="text" name = "h_add"></br></td></tr>
        Number : <input type = "Number" name = "c_num"></br></td></tr>
        <input type="submit" name="submit" value="add"></br></td></tr>

        <a href="insertxml.php">
        <input type="button" style="color: red;" value="Delete to comman"></button></a></td></tr>

Source: Ask PHP