Search the Community
Showing results for tags 'webservices nusoap'.
-
Hi , Could some one help me . I am new to webservices . I have client request like <v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"><v:Header /><v:Body><n0:Mghonttrd id="o0" c:root="1" xmlns:n0="http://mytestwebsite4soap.com"><Mghonttrd i:type="n0:Mghonttrd"><ngtrgs i:type="d:string">444</ngtrgs></Mghonttrd></n0:Mghonttrd></v:Body></v:Envelope> I want server to check the dynamic value of string " ngtrgs" and send the result according to the value by using if condition. suppose if ngtrgs=444 then it should return array('status'=>"active", 'Name'=>"abhi", 'age=>"20", 'class'=>"12"); if ngtrgs= 555 then return array('status'=>"active", 'Name'=>"vinay", 'age=>"19", 'class'=>"12"); server side i have code .... etc., server side code is below <?php require_once './nusoap/lib/nusoap.php'; //Retrieve zip code for textual area //Logic of the web service function Mghonttrd($ngtrgs) { //if ($ngtrgs == "444") { return array('status'=>"active", 'Name'=>"abhi", 'age=>"20", 'class'=>"12"); } } //Register web service function so that clients can access $server = new soap_server(); $server->register('Mghonttrd'); $POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : ''; $server->service($POST_DATA); ?> Thankyou