Login   Register  
PHP Classes
elePHPant
Icontem

File: service.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Erwin Kooi  >  DB Web Service  >  service.php  >  Download  
File: service.php
Role: Application script
Content type: text/plain
Description: Access script for callers
Class: DB Web Service
SOAP Web service to provide remote database access
Author: By
Last change:
Date: 2005-03-29 09:19
Size: 1,386 bytes
 

Contents

Class file image Download
<?
    $SCRIPT_URL
="http://".$_SERVER["SERVER_NAME"].($_SERVER["SERVER_PORT"]!="80"?":".$_SERVER["SERVER_PORT"]:"").$_SERVER["SCRIPT_NAME"];
    
    
define ("SERVICE_NAME","DB");
    
define ("SERVICE_LOCATION",$SCRIPT_URL);
    
define ("SCRIPT_URL",$SCRIPT_URL);
    
define ("TARGETNAMESPACE",$SCRIPT_URL);
    
define ("SOURCENAMESPACE",$SCRIPT_URL);
    
    
    require_once (
"db.inc.php");
    require_once (
"domain.php");
    require_once (
"DBWebService.php");
    require_once (
"handle_request.php");
    
    
header("Content-type: text/xml");
       
ob_start();
    echo 
"<"."?"."xml version=\"1.0\""."?".">";

    if (isset(
$_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD']=='POST') { 
        
service($HTTP_RAW_POST_DATA); 
    } else { 
        if (isset(
$_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'],'wsdl') == 0) { 
            echo 
getWSDL(); 
        } else { 
?><disco:discovery xmlns:disco="http://schemas.xmlsoap.org/disco/" xmlns:scl="http://schemas.xmlsoap.org/disco/scl/">
<scl:contractRef ref="<? echo $SCRIPT_URL ?>?wsdl" />
</disco:discovery><?
        
}
    }
    
    
$output ob_get_contents();
       
ob_end_clean();

    
$fp fopen("debug.txt","wb");
    
fwrite($fp,"URL:".$SCRIPT_URL."\n");
    
fwrite($fp,"QUERY_STRING:".@$_SERVER['QUERY_STRING']."\n");
    
fwrite($fp,"request:\n--------\n".@$HTTP_RAW_POST_DATA);
    
fwrite($fp,"response:\n--------\n".$output);
    
fclose($fp);
    
    die (
$output);
    
?>