Creating a php webservice for C#
Probably a lot of you are wonder if is possible to access a php webservice from C#, so I made a simple test to show you is possible
.
In this test I used nusoap and php4. In the future I will do the test with PHP5 and it’s SOAP library.
//ws.php
require_once(“lib/nusoap.php”);
$ns=”http://your.server.address/”;$param = array(‘x’ => ‘xsd:string’,'y’ => ‘xsd:string’);
$return = array(‘return’=>’xsd:string’);$server = new soap_server();
$server->configureWSDL(‘WS Test’,$ns);
$server->wsdl->schemaTargetNamespace=$ns;
$server->register(‘TestFunction’,$param,$return,$ns);function TestFunction($x,$y){
$ret=$x+$y;
return new soapval(‘return’,'xsd:string’,$ret);
}$server->service($HTTP_RAW_POST_DATA);
To access this webservice just go to: http://your.server.address/ws.php?wsdl























Leave your response!