Thursday, March 20, 2014

My Hello World, WebService , Java & PHP

This tutorial is based on SOAP.

1.Open the netbeans.
2. Create a new project.
3. Create a Webservice standalone.
 
4. Testing by php

uaa@uaa-virtual-machine:~$ php cliente.php 
stdClass Object
(
    [return] => Hello fco !
)

uaa@uaa-virtual-machine:~$ cat cliente.php 
<?php 
try {  
    $x = @new SoapClient("http://localhost:8080/EjemploWebService/HolaMundo?WSDL");  
 print_r( $x->hello(array('name'=>'fco')));
} catch (Exception $e) {  
    echo $e->getMessage(); 
?> 
uaa@uaa-virtual-machine:~$ php cliente.php 
stdClass Object
(
    [return] => Hello fco !
)

uaa@uaa-virtual-machine:~$ 



No comments:

Post a Comment