title: Insert data into MySql using nusoap web service?
body: <p>I have created this code to insert data into my database using nusoap. Everything is working fine but the data are not inserted at my database.</p>
  
  <p>Here is the code</p>
  
  <pre><code>require_once('nusoap/nusoap.php');
  
  $server = new soap_server();
  
  $server-&gt;configureWSDL('Insert Order', 'urn:InsertOrder');
  
  $server-&gt;soap_defencoding = 'utf-8';
  
  $server-&gt;register(
      'InsertOrder',
      array('FirstName' =&gt; 'xsd:Testing', 'LastName' =&gt; 'xsd:NuSoap'),
      array('return' =&gt;'xsd:boolean'),
      'urn:InsertOrderwsdl', 
      'urn:InsertOrderwsdl#InsertOrder', 
      'rpc', 
      'literal'      
  );
  
  function InsertOrder($FirstName, $LastName) {
  
  $connect = mysql_pconnect("localhost","root","");
  if ($connect) {       
      if(mysql_select_db("database", $connect)) {
    mysql_query("INSERT INTO myuser SET FirstName='$FirstName',     LastName='$LastName'");   
          return true;
      }
  }
  return false;
  }
  
  $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
  $server-&gt;service($HTTP_RAW_POST_DATA);
  </code></pre>
  
  <p>Here is the wsdl file:</p>
  
  <pre><code>&lt;definitions targetNamespace="urn:InsertOrder"&gt;
  &lt;types&gt;
  &lt;xsd:schema targetNamespace="urn:InsertOrder"&gt;
  &lt;xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
  &lt;xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/&gt;
  &lt;/xsd:schema&gt;&lt;/types&gt;
  &lt;message name="InsertOrderRequest"&gt;
  &lt;part name="FirstName" type="xsd:Testing"/&gt;
  &lt;part name="LastName" type="xsd:NuSoap"/&gt;
  &lt;/message&gt;
  &lt;message name="InsertOrderResponse"&gt;
  &lt;part name="return" type="xsd:boolean"/&gt;
  &lt;/message&gt;&lt;portType name="Insert OrderPortType"&gt;
  &lt;operation name="InsertOrder"&gt;
  &lt;input message="tns:InsertOrderRequest"/&gt;
  &lt;output message="tns:InsertOrderResponse"/&gt;
  &lt;/operation&gt;
  &lt;/portType&gt;
  &lt;binding name="Insert OrderBinding" type="tns:Insert OrderPortType"&gt;
  &lt;soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  &lt;operation name="InsertOrder"&gt;
  &lt;soap:operation soapAction="urn:InsertOrderwsdl#InsertOrder" style="rpc"/&gt;
  &lt;input&gt;
  &lt;soap:body use="literal" namespace="urn:InsertOrderwsdl"/&gt;
  &lt;/input&gt;
  &lt;output&gt;
  &lt;soap:body use="literal" namespace="urn:InsertOrderwsdl"/&gt;
  &lt;/output&gt;
  &lt;/operation&gt;&lt;/binding&gt;
  &lt;service name="Insert Order"&gt;
  &lt;port name="Insert OrderPort" binding="tns:Insert OrderBinding"&gt;
  &lt;soap:address location="http://localhost/nuSoap/MyService.php"/&gt;
  &lt;/port&gt;
  &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>At wsdl file the parameters and the output is ok. What i don't understand why is not putting these data into my database? i must miss something here. Anyone has any idea why is this happening? Thank you in advance.</p>