NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Please help me to implemet SOAP-PHP : For Beginner


Joined: 14 Apr 2010
Posts: 1
Reply with quote
Hello Everybody,
I am trying to implement SOAP- PHP - to transfer the following form data : ( transferring By HTTP request to another client)

Need to send following data:
Firstname
lastname
Phonenumber
Email address
Contact preferences
Address
City
State
Zip
Categories
timeline
Monthlybill
etc.

I am beginner in SOAP. I have no idea how to implement this. Could you please anyone give me idea how to follow the algorithm. How can i code it and what tool/interface I need for this ?
If you know the similar form implemented SOAP- PHP example; please send me the link. I would feel great if somebody help me by sending the Example in my email as well : <bchaulag@bridgeport.edu>

I have that form already designed in my webwite and data stores in MYSQL databse. Now i need SOAP implementation procedure.
Please reply me.
Expecting your help!

Thank you.
Adam
Norwalk, CT
View user's profileFind all posts by adamSend private message
how to


Joined: 20 Apr 2010
Posts: 2
Reply with quote
Hi Adam,

"and what tool/interface I need for this" : any particular interface or tool. Just the PHP page where you receive your form datas + a PHP page where you'll write all methods(functions) you need (and you must have NuSOAP library too, of course ^^).

So, in the first PHP page with your form datas :

Code:
<?php
   //the following require_once() path must be a relative path
   require_once('../path/to/nusoap.php');
   //the nusoap_client() must be an absolute URL
   $nusoap = new nusoap_client("http://www.website.com/my_methods_page.php");
               
   //here you make your datas array
   $datas = array(
      'name' => 'Bubu',
      'job' => 'developper',
      ...
   );
      
   //Now, you call the method "registerUser" (in my_methods_page.php) by passing your datas array we'll just print_r()
   print_r( $nusoap->call('registerUser',array( 'datas' => $datas )) );
?>


Now, in my_methods_page.php :[/u]

Code:
<?php
   //the following require_once() path must be a relative path
   require_once('../path/to/nusoap.php');
   
   //instanciate a new soap server
   $server = new soap_server();
   
   //declare all your existing methods (note that only methods called somewhere else than here must be declare. no need to declare privates)
   $server -> register('registerUser');
      
   //your method to register
   function registerUser($datas)
   {
      //here your code to write in database. i just wrote a return for you to see the print_r() result : your sent datas array.
      return $datas;
    }
   
   $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
   // Executes the RPC
   $server -> service($HTTP_RAW_POST_DATA);
   
?>



i hope it will help you (and hope i don't forget anything Smile)

BenoƮt

PS : sorry for my english
View user's profileFind all posts by BubuSend private messageSend e-mail
Please help me to implemet SOAP-PHP : For Beginner
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic