本文整理汇总了PHP中WSService类的典型用法代码示例。如果您正苦于以下问题:PHP WSService类的具体用法?PHP WSService怎么用?PHP WSService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WSService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: procesar
function procesar()
{
toba::logger_ws()->debug('Servicio Llamado: ' . $this->info['basica']['item']);
toba::logger_ws()->set_checkpoint();
set_error_handler('toba_logger_ws::manejador_errores_recuperables', E_ALL);
$this->validar_componente();
//-- Pide los datos para construir el componente, WSF no soporta entregar objetos creados
$clave = array();
$clave['proyecto'] = $this->info['objetos'][0]['objeto_proyecto'];
$clave['componente'] = $this->info['objetos'][0]['objeto'];
list($tipo, $clase, $datos) = toba_constructor::get_runtime_clase_y_datos($clave, $this->info['objetos'][0]['clase'], false);
agregar_dir_include_path(toba_dir() . '/php/3ros/wsf');
$opciones_extension = toba_servicio_web::_get_opciones($this->info['basica']['item'], $clase);
$wsdl = strpos($_SERVER['REQUEST_URI'], "?wsdl") !== false;
$sufijo = 'op__';
$metodos = array();
$reflexion = new ReflectionClass($clase);
foreach ($reflexion->getMethods() as $metodo) {
if (strpos($metodo->name, $sufijo) === 0) {
$servicio = substr($metodo->name, strlen($sufijo));
$prefijo = $wsdl ? '' : '_';
$metodos[$servicio] = $prefijo . $metodo->name;
}
}
$opciones = array();
$opciones['serviceName'] = $this->info['basica']['item'];
$opciones['classes'][$clase]['operations'] = $metodos;
$opciones = array_merge($opciones, $opciones_extension);
$this->log->debug("Opciones del servidor: " . var_export($opciones, true), 'toba');
$opciones['classes'][$clase]['args'] = array($datos);
toba::logger_ws()->set_checkpoint();
$service = new WSService($opciones);
$service->reply();
$this->log->debug("Fin de servicio web", 'toba');
}
开发者ID:emma5021,项目名称:toba,代码行数:35,代码来源:toba_solicitud_servicio_web.php
示例2: __construct
/**
* @param array $args this should have entries for
* "config" and "operations" + other WSService constrctor arguments
*/
public function __construct($args)
{
// validating the user args
if (!array_key_exists(DS_CONFIG, $args)) {
DSUtils::error_log(__FILE__, __LINE__, "Configs are missing in the DataService constructor");
}
if (!array_key_exists(DS_OPERATIONS, $args)) {
DSUtils::error_log(__FILE__, __LINE__, "Operations are missing in the DataService constructor");
}
// deriving operations for WSService constructor
$wsservice_operatoins = array();
// build the operation array for the WSService constructor
$args_ops = $args[DS_OPERATIONS];
foreach ($args_ops as $key => $value) {
$wsservice_operations[$key] = $key;
}
// building the WSService construtor arguments
$wsservice_args = array(DS_CLASSES => array(DS_PROCESSOR_HANDLER => array(DS_OPERATIONS => $wsservice_operations, DS_ARGS => array($args))));
/* put all the arguments except the operations and config
as arguments for the WSConstructor */
foreach ($args as $args_key => $args_value) {
if ($args_key != DS_OPERATIONS && $args_key != DS_CONFIG) {
$wsservice_args[$args_key] = $args_value;
}
}
$args_config = $args[DS_CONFIG];
$wsservice_args[DS_ANNOTATIONS] = $this->generate_annotations($args_ops, $args_config);
// call the parent constructor
parent::__construct($wsservice_args);
}
开发者ID:ztobs,项目名称:wsf,代码行数:34,代码来源:DataService.php
示例3: echoFunction
<?php
/*
* Copyright 2005,2008 WSO2, Inc. http://wso2.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function echoFunction($inMessage)
{
$returnMessage = new WSMessage($inMessage->str);
return $returnMessage;
}
$cert = ws_get_cert_from_file("../../keys/bob_cert.cert");
$pvt_key = ws_get_key_from_file("../../keys/bob_key.pem");
$operations = array("echoString" => "echoFunction");
$policy_xml = file_get_contents("policy.xml");
$policy = new WSPolicy($policy_xml);
$sec_token = new WSSecurityToken(array("privateKey" => $pvt_key, "certificate" => $cert));
$actions = array("http://wso2.org/wsfphp/samples/echoString" => "echoString");
$svr = new WSService(array("operations" => $operations, "actions" => $actions, "policy" => $policy, "securityToken" => $sec_token));
$svr->reply();
开发者ID:ztobs,项目名称:wsf,代码行数:31,代码来源:service.php
示例4: __construct
/**
* @var array of string $boo2
* maps to xs:duration
*/
public $boo2;
}
/**
* classname FooResponse
* @namespace http://mytest/xsd3
*/
class FooResponse
{
/**
* @var array of object Boo $ret_value
*/
public $ret_value;
public function __construct($param_value)
{
$this->ret_value = $param_value;
}
}
$operations = array("echoString" => "echoValue");
$opParams = array("echoValue" => "MIXED");
$actions = array("urn:echoString" => "echoString");
$classmap = array("Foo" => "Foo", "Bay" => "Bay");
// Security options
$policy_xml = file_get_contents("policy.xml");
$policy = new WSPolicy($policy_xml);
$security_token = new WSSecurityToken(array("user" => "Alice", "password" => "abcd!123", "passwordType" => "Digest"));
$service = new WSService(array("classes" => array("Bar" => array("operations" => $operations, "args" => array("Welcome", "Bye!"))), "bindingStyle" => "doclit", "cacheWSDL" => FALSE, "useWSA" => TRUE, "policy" => $policy, "securityToken" => $security_token, "actions" => $actions, "classmap" => $classmap, "opParams" => $opParams));
$service->reply();
开发者ID:ztobs,项目名称:wsf,代码行数:31,代码来源:policy_service.php
示例5: ws_reply
function ws_reply($options)
{
$svr = new WSService($options);
$svr->reply();
}
开发者ID:emma5021,项目名称:toba,代码行数:5,代码来源:wsf.php
示例6: file_put_contents
if (stristr(PHP_OS, 'WIN')) {
$imageName = $i . "." . "jpg";
$file_saved = file_put_contents($imageName, $f);
} else {
$imageName = $i . "." . "jpg";
$file_saved = file_put_contents("/tmp/" . $imageName, $f);
}
}
}
if ($file_saved) {
$resPayload = <<<XML
<ns1:response xmlns:ns1="http://wso2.org/wsfphp/samples/mtom">Image Saved</ns1:response>
XML;
} else {
$resPayload = <<<XML
<ns1:response xmlns:ns1="http://wso2.org/wsfphp/samples/mtom">Image Saving Failed</ns1:response>
XML;
}
$returnMessage = new WSMessage($resPayload);
return $returnMessage;
}
$alice_cert = ws_get_cert_from_file("../../keys/alice_cert.cert");
$pub_key = ws_get_cert_from_file("../../keys/bob_cert.cert");
$pvt_key = ws_get_key_from_file("../../keys/bob_key.pem");
$policy_xml = file_get_contents("policySignOnlyMtom.xml");
$policy = new WSPolicy($policy_xml);
$sec_token = new WSSecurityToken(array("privateKey" => $pvt_key, "certificate" => $pub_key, "receiverCertificate" => $alice_cert));
$actions = array("http://wso2.org/upload" => "upload");
$operations = array("upload" => "getAttachment");
$server = new WSService(array("operations" => $operations, "actions" => $actions, "requestXOP" => TRUE, "policy" => $policy, "securityToken" => $sec_token));
$server->reply();
开发者ID:ztobs,项目名称:wsf,代码行数:31,代码来源:service.php
示例7: echoFunction
<?php
/*
* Copyright 2005,2008 WSO2, Inc. http://wso2.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* sample test payload */
$requestPayloadString = <<<XML
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header/><soapenv:Body><ns1:echoString xmlns:ns1="http://wso2.org/wsfphp/samples"><text>Hello World!</text></ns1:echoString></soapenv:Body></soapenv:Envelope>
XML;
function echoFunction($inMessage)
{
$outMessage = new WSMessage($inMessage->str);
return $outMessage;
}
$operations = array("echoString" => "echoFunction");
$service = new WSService(array("operations" => $operations));
$service->reply($requestPayloadString);
开发者ID:ztobs,项目名称:wsf,代码行数:29,代码来源:echo_service.php
示例8: sendFault
<?php
$reqPayloadString = <<<XML
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header/>
<soapenv:Body>
<ns1:getFault xmlns:ns1="http://php.axis2.org/samples">
<text>Hello World!</text>
</ns1:getFault>
</soapenv:Body></soapenv:Envelope>
XML;
function sendFault($inMessage)
{
return new WSFault(NULL, NULL);
}
$operations = array("getFault" => "sendFault");
$svr = new WSService(array("operations" => $operations));
$svr->reply($reqPayloadString);
开发者ID:ztobs,项目名称:wsf,代码行数:18,代码来源:ws_fault_without_code_and_reason.php
注:本文中的WSService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论