PHP Classes

File: wsserver/WSOTCore.php

Recommend this page to a friend!
  Classes of Mario Carrocera   Easy PHP SOAP Server Web Service   wsserver/WSOTCore.php   Download  
File: wsserver/WSOTCore.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Easy PHP SOAP Server Web Service
SOAP based Web Services using callback functions
Author: By
Last change:
Date: 3 years ago
Size: 1,983 bytes
 

Contents

Class file image Download
<?php
include_once '../NuSoap/nusoap.php';

$server = new soap_server();

$server->configureWSDL('On Time Core', 'urn:server');
$server->wsdl->schemaTargetNamespace = 'urn:server';

$server->register('Conect',
array(
'user' => 'xsd:string', 'password' => 'xsd:string'),
array(
'return' => 'xsd:string'),
'urn:server',
'urn:server#loginServer',
'rpc',
'encoded',
'Basic Information');

$server->register('PssChk',
array(
'user' => 'xsd:string', 'password' => 'xsd:string'),
array(
'return' => 'xsd:string'),
'urn:server',
'urn:server#loginServer',
'rpc',
'encoded',
'Validate User and password');


function
Conect($user, $password)
{
    include_once
'../ontime/"OnTime.php';
   
$ws=new OnTime();
   
$ws->Connect($user,$password);
    if (
$ws->err=="0") {
   
$response = array('status'=> True,'return'=> array('Conect'->$ws->conected,"Error"=>$ws->errtext,'Features'=>$ws->features,'level'=>$ws->level,'status'=>$ws->status,'public'=>$ws->user,'private'=>$ws->userp,'safety'=>$ws->safety));
    } else{
        if (
array_key_exists($ws->err, $ws->errtext)) {
           
$response = array('status'=> False,'return'=> array('code'=> $ws->err,'msg'=> $this->errtext[$this->err]));
        } else{
           
$response = array('status'=> False,'return'=> array('code'=> $ws->err,'msg'=> 'Not Defined'));
        }
    }
    return
json_encode($response);
}

function
PssChk($user, $password)
{
    include_once
'../ontime/"OnTime.php';
   
$ws=new OnTime();
   
$ws->PssChk($user,$password);
    if (
$ws->err=="0") {
       
$response = array('status'=> True,'return'=> 'Empty');
    } else{
        if (
array_key_exists($ws->err, $ws->errtext)) {
           
$response = array('status'=> False,'return'=> array('code'=> $ws->err,'msg'=> $this->errtext[$this->err]));
        } else{
           
$response = array('status'=> False,'return'=> array('code'=> $ws->err,'msg'=> 'Not Defined'));
        }
    }
    return
json_encode($response);
}

$server->service(file_get_contents("php://input"));

?>