X-Git-Url: http://git.pjr.cc/?p=glcas.git;a=blobdiff_plain;f=www%2Fsoap.php;h=281b468175e199fa6992d3992f67c4a9686a6547;hp=454c201f5cce7d868540ae9e5a710da557814a77;hb=7038178201d82ccb9eadad37ee5b95e01d838836;hpb=9ce9b80f33afddf2a4d3172e877d38489f8f55bb diff --git a/www/soap.php b/www/soap.php index 454c201..281b468 100644 --- a/www/soap.php +++ b/www/soap.php @@ -4,33 +4,54 @@ require_once("../lib/lib.php"); $soapFunctions["status"] = "status"; global $soapFunctions; -function status() +function status($status) { - return "im good"; + $lk = new dataContainer(); + $lk->stringpass[0] = "yes"; + $lk->stringpass[1] = "np"; + return $lk; } if(isset($_REQUEST["wsdl"])) { - generateWSDL(); + $mylocation = "http://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + generateWSDL($mylocation, $soapFunctions); exit(0); } if(isset($_REQUEST["xsd"])) { - //generateXSD(); + $mylocation = "http://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + generateXSD($mylocation, $soapFunctions); exit(0); } -function generageWSDL() +if($_SERVER["REQUEST_METHOD"] != "POST") { + $mylocation = "http://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + generateWSDL($mylocation, $soapFunctions); + exit(0); +} + +function generateWSDL($location, $functions) +{ + header("Content-type: text/xml"); + $wsdl = sp_generateWSDL($location, $functions); + echo $wsdl; +} + +function generateXSD($location, $functions) { - + header("Content-type: text/xml"); + $wsdl = sp_generateXSD($location, $functions); + echo $wsdl; } -$s = new SoapServer(NULL, array( "uri" => "http://pjr.cc/glcas")); +$mylocation = "http://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; +$s = new SoapServer("$mylocation?wsdl"); foreach($soapFunctions as $function) { $s->addFunction($function); } -print_r($s->getFunctions()); +$s->handle(); ?> \ No newline at end of file