Hi,
i want to start creating and accessing web services using php....i tried searching around the internet....but came up with lots of code which were too
difficult for me....can anyone please tell where can i find a simple tutorial to develop web services using php?
web services in php
Moderator: General Moderators
Re: web services in php
First of all, recognize that web services is not a simple operation, so you won't find a truly "simple" tutorial. But it's true that a lot of information on the web is more complicated than necessary for learning the fundamentals. This one is perhaps as simple as I can find quickly: http://www.ferdychristant.com/blog//art ... OMM-6J2QFF
-
away_young
- Forum Newbie
- Posts: 3
- Joined: Sat Mar 26, 2011 12:30 am
Re: web services in php
Thank you califdon for the reply....i will go through the website....
-
away_young
- Forum Newbie
- Posts: 3
- Joined: Sat Mar 26, 2011 12:30 am
Re: web services in php
hi,
i am able to get the web service to work without using WSDL....but when i try to use WSDL..i get a page telling me
'Connection to the server was reset while the page was loading'..i am putting my client as well as my server code here...can anyone tell me what the problem is?
client code
server code
i am able to get the web service to work without using WSDL....but when i try to use WSDL..i get a page telling me
'Connection to the server was reset while the page was loading'..i am putting my client as well as my server code here...can anyone tell me what the problem is?
client code
Code: Select all
<?php
require_once('lib/nusoap.php');
$client = new soapclient('http://localhost/WebServices_WSDL/server.php?wsdl', true);
$result = $client->call('hello', array('name' => 'bye'));
print_r($result);
?>
Code: Select all
<?php
require_once('lib/nusoap.php');
$server = new soap_server();
$server->configureWSDL('server', 'urn:server');
$server->register('hello',
array('name' => 'xsd:string'),
array('return' => 'xsd:string'),
'urn:server',
'urn:server#hello',
'rpc',
'encoded',
'Says hello '
);
function hello($name) {
return 'Hello, ' . $name;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>