[PHP] How to call webservice without WSDL
Posted in PHP on 04/26/2009 10:11 pm by ycTINSo simple, see below.
server.php
<?php class TestWebService { function hello($you_name = 'ycTIN') { return "hi, i am $you_name"; } } $server = new SoapServer(null, array ('uri'=>'')); $server->setClass('TestWebService'); $server->handle(); ?> |
client.php
<?php $options = array ( 'location'=>'http://www.yctin.com/webservice/TestWebService/server.php', 'uri'=>'' ); $client = new SoapClient(null, $options); echo $client->hello('ycTIN'); ?> |
Related posts:
- Popular HTTP response status code in the web development The popular HTTP response code with simple description: 2xx Success...
- [PHP] Detect and handle execution timeout error Sometime php will throw unhandled exception, e.g. over maximum execution...
Tags: PHP, SOAP, WebService, WSDL

