-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
2,634 additions
and
4,290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/examples export-ignore | ||
/vendor export-ignore | ||
/docs export-ignore | ||
/tests export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.travis.yml export-ignore | ||
/phpunit.xml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/.idea/ | ||
|
||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# cloudking | ||
A SOAP Server Engine for PHP 5.2 and higher. | ||
A SOAP Server Engine for PHP 5.6 and higher. | ||
|
||
It supports SOAP 1.1, 1.2 or both. JAVA usually supports 1.1, C# supports both. | ||
|
||
For php 7.0 and higher its not working, so its in ALPHA. | ||
|
||
--It doesn't work-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "eftec/cloudking", | ||
"type": "library", | ||
"description": "A SOAP webserver for PHP", | ||
"license": "LGPL", | ||
"version": "2.4", | ||
"authors": [ | ||
{ | ||
"name": "Jorge Castro", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.6", | ||
"ext-json": "*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"eftec\\cloudking\\": "lib/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
|
||
/** | ||
* @generated The structure of this class is generated by CloudKing | ||
* Class Example2WSService | ||
*/ | ||
class Example2WSService { | ||
function getDB() { | ||
$r=@file_get_contents('data.txt'); | ||
if($r===false) { | ||
return []; | ||
} | ||
return unserialize($r); | ||
} | ||
function saveDB($content) { | ||
$r=file_put_contents('data.txt',serialize($content)); | ||
} | ||
|
||
|
||
function ping($ping_param) { | ||
try { | ||
|
||
|
||
return $ping_param; | ||
} catch (Exception $_exception) { | ||
return(array("soap:Fault"=>'Caught exception: '. $_exception->getMessage())); | ||
} | ||
} | ||
|
||
function GetProducto($idProducto) { | ||
try { | ||
|
||
$all=$this->getDB(); | ||
foreach($all as $item) { | ||
if($item['idProducto']===$idProducto) { | ||
$_Producto=$item; | ||
break; | ||
} | ||
} | ||
|
||
return $_Producto; | ||
} catch (Exception $_exception) { | ||
return(array("soap:Fault"=>'Caught exception: '. $_exception->getMessage())); | ||
} | ||
} | ||
|
||
function InsertProducto($Producto) { | ||
try { | ||
|
||
$all=$this->getDB(); | ||
$all[]=$Producto; | ||
$this->saveDB($all); | ||
return count($all); | ||
} catch (Exception $_exception) { | ||
return(array("soap:Fault"=>'Caught exception: '. $_exception->getMessage())); | ||
} | ||
} | ||
|
||
function GetProductos() { | ||
try { | ||
|
||
return $this->getDB(); | ||
} catch (Exception $_exception) { | ||
return(array("soap:Fault"=>'Caught exception: '. $_exception->getMessage())); | ||
} | ||
} | ||
|
||
function factoryProducto($idProduct=0,$nombre='',$precio=0) { | ||
$_Producto['idProduct']=$idProduct; | ||
$_Producto['nombre']=$nombre; | ||
$_Producto['precio']=$precio; | ||
|
||
} | ||
|
||
function factoryProductoArray($Producto=array()) { | ||
$_ProductoArray['Producto']=$Producto; | ||
|
||
} | ||
} // end class | ||
|
||
/************************************ Complex Types (Classes) ************************************/ | ||
|
||
class Producto { | ||
var $idProduct; // s:integer | ||
var $nombre; // s:string | ||
var $precio; // s:integer | ||
} | ||
|
||
class ProductoArray { | ||
var $Producto; // tns:Producto | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<? | ||
|
||
use eftec\cloudking\CloudKingClient; | ||
|
||
include "../vendor/autoload.php"; | ||
|
||
|
||
$x=new ExampleCLient(); | ||
echo "<pre>"; | ||
var_dump($x->GetProductos()); | ||
echo "</pre>"; | ||
/***************************************** Implementation *****************************************/ | ||
class ExampleCLient { | ||
var $url='http://localhost/currentproject/cloudking/examples/example2.php'; | ||
var $tempuri='examplenamespace'; | ||
|
||
// Descripcion :Prueba de conexion | ||
// ping_param = | ||
function ping($ping_param) { | ||
$_obj=new CloudKingClient(); | ||
$_obj->soap='1.1'; | ||
$_obj->tempuri=$this->tempuri; | ||
$_param=''; | ||
$_param.=$_obj->array2xml($ping_param,'ts:ping_param',false,false); | ||
$resultado=$_obj->loadurl($this->url,$_param,'ping'); | ||
return @$resultado['pingResult']; | ||
} | ||
|
||
// Descripcion :GetSin obtiene los datos de una SIN | ||
// idProducto = | ||
function GetProducto($idProducto) { | ||
$_obj=new CloudKingClient(); | ||
$_obj->soap='1.1'; | ||
$_obj->tempuri=$this->tempuri; | ||
$_param=''; | ||
$_param.=$_obj->array2xml($idProducto,'ts:idProducto',false,false); | ||
$resultado=$_obj->loadurl($this->url,$_param,'GetProducto'); | ||
return @$resultado['GetProductoResult']; | ||
} | ||
|
||
// Descripcion :Get_sin obtiene los datos de una SIN | ||
function GetProductos() { | ||
$_obj=new CloudKingClient(); | ||
$_obj->soap='1.1'; | ||
$_obj->tempuri=$this->tempuri; | ||
$_param=''; | ||
$resultado=$_obj->loadurl($this->url,$_param,'GetProductos'); | ||
return @$resultado['GetProductosResult']; | ||
} | ||
} // end Sin_WS | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
a:3:{i:0;a:3:{s:10:"idProducto";s:1:"2";s:6:"nombre";s:1:"3";s:6:"precio";s:1:"4";}i:1;a:3:{s:10:"idProducto";s:1:"2";s:6:"nombre";s:1:"3";s:6:"precio";s:1:"4";}i:2;a:3:{s:10:"idProducto";s:1:"6";s:6:"nombre";s:6:"fdfdfd";s:6:"precio";s:6:"dffdfd";}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<? | ||
|
||
use eftec\cloudking\CloudKing; | ||
|
||
@session_start(); | ||
|
||
include "../vendor/autoload.php"; | ||
include "Example2WSService.php"; | ||
|
||
$service=new Example2WSService(); | ||
//$objws->GetSin | ||
|
||
|
||
$FILE = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]; | ||
$NAMESPACE="examplenamespace"; | ||
$NAME_WS='Example2WS'; | ||
|
||
|
||
$ns=new CloudKing($FILE, $NAMESPACE, $NAME_WS); | ||
|
||
$ns->soap12=false; | ||
$ns->verbose=2; | ||
$ns->allowed_format["POST"]=true; | ||
//$ns->allowed_format["GET"]=false; | ||
$ns->variable_type="array"; | ||
$ns->serviceInstance=$service; | ||
$ns->description="Ejemplo servidor SOAPUI"; | ||
|
||
$ns->addfunction("ping", | ||
array( | ||
CloudKing::argPrim('ping_param', 's:string'), | ||
), | ||
array( | ||
CloudKing::argPrim('return', 's:string') | ||
), | ||
"Descripcion :Prueba de conexion" | ||
); | ||
$ns->addfunction("GetProducto", | ||
[ | ||
CloudKing::argPrim('idProducto', 's:integer') | ||
], | ||
[ | ||
CloudKing::argComplex('return', 'tns:Producto') | ||
], | ||
"Descripcion :obtiene los datos de una objeto" | ||
); | ||
$ns->addfunction("InsertProducto", | ||
array( | ||
CloudKing::argComplex('Producto', 'tns:Producto') | ||
), | ||
array( | ||
CloudKing::argPrim('return', 's:boolean') | ||
), | ||
"Descripcion :obtiene los datos de una objeto" | ||
); | ||
$ns->addfunction("GetProductos", | ||
[ | ||
|
||
], | ||
[ | ||
CloudKing::argList('return', 'tns:Producto', 0, 'unbounded') | ||
], | ||
"Descripcion :Obtiene una lista de productos" | ||
); | ||
|
||
// ***** type | ||
$ns->addtype("Producto", | ||
[ | ||
CloudKing::argPrim('idProduct','s:integer'), | ||
CloudKing::argPrim('nombre','s:string'), | ||
CloudKing::argPrim('precio','s:integer') | ||
]); | ||
$ns->addtype("ProductoArray", | ||
array( | ||
CloudKing::argList('Producto','tns:Producto','0','unbounded') | ||
)); | ||
|
||
$r=$ns->run(); | ||
echo $r; | ||
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.