当前位置: 首页>>代码示例>>PHP>>正文


PHP WSService::reply方法代码示例

本文整理汇总了PHP中WSService::reply方法的典型用法代码示例。如果您正苦于以下问题:PHP WSService::reply方法的具体用法?PHP WSService::reply怎么用?PHP WSService::reply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WSService的用法示例。


在下文中一共展示了WSService::reply方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: echoFunction

/*
 * 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,代码行数:29,代码来源:service.php

示例3: __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,代码行数:30,代码来源:policy_service.php

示例4: ws_reply

function ws_reply($options)
{
    $svr = new WSService($options);
    $svr->reply();
}
开发者ID:emma5021,项目名称:toba,代码行数:5,代码来源:wsf.php

示例5: WSMessage

                $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,代码行数:30,代码来源:service.php

示例6: 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

示例7: 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::reply方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。