本文整理汇总了PHP中Zend_Soap_Client类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Soap_Client类的具体用法?PHP Zend_Soap_Client怎么用?PHP Zend_Soap_Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Soap_Client类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction() {
$code = $this->_getParam('code');
try {
$url = 'http://10.0.0.75/soap-re-1.0.php?wsdl';
$clientSOAP = new Zend_Soap_Client($url);
$clientSOAP->sendCode($code);
}
catch (SoapFault $e) {
echo $e->__toString();
}
}
示例2: clientAction
public function clientAction()
{
$client = new Zend_Soap_Client($this->_WSDL_URI);
$this->view->add_result = $client->math_add(11, 55);
$this->view->logical_not_result = $client->logical_not(true);
$this->view->sort_result = $client->simple_sort(array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"));
}
示例3: authenticate
public function authenticate()
{
$this->_authenticateSetup();
$dbSelect = $this->_authenticateCreateSelect();
$resultIdentities = $this->_authenticateQuerySelect($dbSelect);
if (is_null($resultIdentities) || !isset($resultIdentities) || empty($resultIdentities)) {
return $this->_authenticateValidateResultSet(array());
}
$config = Zend_Registry::get('config');
$host = $config['auth']['adconnector']['host'];
$salt = $config['auth']['adconnector']['salt'];
$options = array('location' => $host, 'uri' => $host);
$client = new Zend_Soap_Client($host, $options);
$hash = md5($salt . $this->_identity . date('Y-m-d') . $this->_credential);
$zendAuthCredentialMatchColumn = $this->_zendDb->foldCase('zend_auth_credential_match');
$adConnectorAuthValues = array('userName' => $this->_identity, 'password' => $this->_credential, 'hash' => $hash);
try {
$adconnector_result = $client->Authenticate($adConnectorAuthValues);
} catch (Exception $e) {
return $this->_authenticateValidateResultSet(array());
}
$resultIdentity = array_shift($resultIdentities);
$resultIdentity[$zendAuthCredentialMatchColumn] = $adconnector_result->AuthenticateResult->IsAuthenticated || $adconnector_result->AuthenticateResult->IsOldPassword;
$resultIdentity['passwordExpired'] = false;
if ($adconnector_result->AuthenticateResult->IsOldPassword) {
$resultIdentity['passwordExpired'] = true;
}
$result = $this->_authenticateValidateResult($resultIdentity);
return $result;
}
示例4: getClient
/**
* Get the HTTP Client for communication with the VERS SOAP service.
* @return Zend_Http_Client
*/
public function getClient()
{
if (is_null($this->_client)) {
$this->setClient(new Zend_Soap_Client($this->_wsdl));
$this->_client->setSoapVersion(SOAP_1_1);
}
return $this->_client;
}
示例5: testObjectResponse
public function testObjectResponse()
{
$wsdl = $this->baseuri . "/server2.php?wsdl";
$client = new Zend_Soap_Client($wsdl);
$ret = $client->request("test", "test");
$this->assertTrue($ret instanceof stdClass);
$this->assertEquals("test", $ret->foo);
$this->assertEquals("test", $ret->bar);
}
示例6: searchUsingWsdlFile
/**
* @test
*/
public function searchUsingWsdlFile()
{
$soapClient = new \Zend_Soap_Client($this->_getDomain() . $this->_getUrl() . '?wsdl');
$result = $soapClient->search('symfony', 'php');
$this->assertInstanceOf('stdClass', $result);
$this->assertTrue($result->success);
$this->assertNull($result->message);
$this->assertInternalType('array', $result->results);
$this->assertGreaterThan(0, count($result->results));
}
示例7: testGetOptions
public function testGetOptions()
{
if (!extension_loaded('soap')) {
$this->markTestSkipped('SOAP Extension is not loaded');
}
$client = new Zend_Soap_Client();
$this->assertTrue($client->getOptions() == array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_2));
$options = array('soap_version' => SOAP_1_1, 'wsdl' => dirname(__FILE__) . '/_files/wsdl_example.wsdl', 'classmap' => array('TestData1' => 'Zend_Soap_Client_TestData1', 'TestData2' => 'Zend_Soap_Client_TestData2'), 'encoding' => 'ISO-8859-1', 'uri' => 'http://framework.zend.com/Zend_Soap_ServerTest.php', 'location' => 'http://framework.zend.com/Zend_Soap_ServerTest.php', 'use' => SOAP_ENCODED, 'style' => SOAP_RPC, 'login' => 'http_login', 'password' => 'http_password', 'proxy_host' => 'proxy.somehost.com', 'proxy_port' => 8080, 'proxy_login' => 'proxy_login', 'proxy_password' => 'proxy_password', 'local_cert' => dirname(__FILE__) . '/_files/cert_file', 'passphrase' => 'some pass phrase', 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 5);
$client->setOptions($options);
$this->assertTrue($client->getOptions() == $options);
}
示例8: getSoapClient
public static function getSoapClient()
{
ini_set("soap.wsdl_cache_enabled", "0");
$conf = Zend_Registry::get("pimcore_config_test");
$user = User::getById($conf->user);
if (!$user instanceof User) {
throw new Exception("invalid user id");
}
$client = new Zend_Soap_Client($conf->webservice->wsdl . "&username=" . $user->getUsername() . "&apikey=" . $user->getPassword(), array("cache_wsdl" => false, "soap_version" => SOAP_1_2, "classmap" => Webservice_Tool::createClassMappings()));
$client->setLocation($conf->webservice->serviceEndpoint . "?username=" . $user->getUsername() . "&apikey=" . $user->getPassword());
return $client;
}
示例9: clientAction
public function clientAction()
{
//need to consume other webservices
$client = new Zend_Soap_Client("http://webteam/soap?wsdl");
$result1 = $client->ValidateUser("admin1", "pass1");
$this->view->result1 = $result1;
$client2 = new Zend_Soap_Client("http://webteam/soap?wsdl");
$result2 = $client2->CreateStream($result1, "title", "description");
$this->view->result2 = $result2;
$client3 = new Zend_Soap_Client("http://webteam/soap?wsdl");
$result3 = $client3->VerifyStream("admin1", $result2);
$this->view->result3 = $result3;
}
示例10: GetImagemSoap
/**
* Helper para pegar as imagens do webservice
*
*/
public function GetImagemSoap($id)
{
// initialize SOAP client
$options = array('location' => 'http://painel.local/webservice/index', 'uri' => 'http://painel.local/webservice/index');
try {
$client = new Zend_Soap_Client(null, $options);
return $client->getImageById($id);
} catch (SoapFault $s) {
die('ERROR: [' . $s->faultcode . '] ' . $s->faultstring);
} catch (Exception $e) {
die('ERROR: ' . $e->getMessage());
}
}
示例11: performRequest
public function performRequest($wsdl, $operation, $params, $options = array('encoding' => 'UTF-8'), $fullReponse = false)
{
if (!extension_loaded('soap')) {
return 'Extension SOAP not found';
}
if (!isset($options['soap_version'])) {
$options['soap_version'] = SOAP_1_1;
}
$client = new Zend_Soap_Client($wsdl, $options);
$soap_params = array();
foreach ($params as $param_name => $param_value) {
preg_match('/^(.*)\\:(.*)$/', $param_name, $matches);
if (count($matches) == 3) {
if (!isset($soap_params[$matches[1]])) {
$soap_params[$matches[1]] = array();
}
$soap_params[$matches[1]][$matches[2]] = $param_value;
} else {
$soap_params[$param_name] = $param_value;
}
}
try {
// Set (Session) cookies before the call
if ($this->allowCookies) {
if (is_array($this->cookies)) {
foreach ($this->cookies as $cookieName => $cookieValue) {
$client->setCookie($cookieName, $cookieValue[0]);
}
}
}
// Perform the SOAP request
$result = call_user_func_array(array($client, $operation), $soap_params);
// Pick up any new cookies from the server
if ($this->allowCookies) {
$last_response = $client->getLastResponseHeaders();
$soapClt = $client->getSoapClient();
$this->cookies = array_merge($soapClt->_cookies, $this->cookies);
}
} catch (SoapFault $e) {
trigger_error($e->getMessage());
return $e->getMessage();
}
// Unless the full response result is specified, only reply the returned result, and not the "out" parameter results
if (is_object($result) && !$fullReponse) {
$result_name = $operation . 'Result';
if (isset($result->{$result_name})) {
return $result->{$result_name};
}
}
return $result;
}
示例12: processTest
private function processTest()
{
$client = new Zend_Soap_Client($this->url('soapserver|soap|WSDL'));
$client->setWsdlCache(false);
$class1 = new soapClassModel();
$class1->name = 'Vasi Tavue';
$class1->accountId = 1;
$class1->classId = 6;
$class1->level = array(7);
$class1->type = 8;
$class1->year = 2011;
$class1->validityDate = '2013-08-31';
$class = new soapClassModel();
$class->name = 'Vasi Tavue';
$class->accountId = 1;
$class->classId = 6;
$class->level = array(7);
$class->type = 8;
$class->year = 2011;
$class->validityDate = '2013-08-31';
$directeur = new soapDirectorModel();
$directeur->name = "jeanClaude";
$directeur->surname = "leCompte";
$directeur->mail = "lecompte@caramail.fr";
$directeur->gender = 1;
$adress = new soapAddressModel();
$adress->address = "4 rue des cochons";
$adress->additionalAddress = "";
$adress->city = "Larochelle";
$adress->postalCode = "76788";
$school = new soapSchoolModel();
$school->name = "DesChamps";
$school->address = $adress;
$school->director = $directeur;
$account = new soapAccountModel();
$account->id = 1;
$account->school = $school;
try {
$j = $client->createAccount($account);
$i = $client->createClass($class);
$k = $client->validateClass($class1);
} catch (Exception $e) {
echo $e;
}
echo '===';
var_dump($i);
var_dump($j);
var_dump($k);
return _arNone();
}
示例13: soapcreateuserAction
public function soapcreateuserAction()
{
$client = new Zend_Soap_Client('http://front.zend.local/Wsserver/index/soap?wsdl');
$client->setHttpLogin('test2')
->setHttpPassword('test');
$userData = array( 'login' => testSoap,
'password' => sha1( 'soap' ),
'nom' => 'WS',
'prenom' => 'SOAP11',
'telephone' => '00000000',
'email' => 'jhkljhl',
'civilite' => 'M');
$return = $client->create( $userData );
var_dump( $return ); exit;
}
示例14: endDocument
/**
* Finaliza o processo de impressao, enviando o documento para
* impressora ou arquivo
*
* @return boolean
* @throws ZendT_Exception_Error
*/
public function endDocument()
{
if (!$this->_idDocument) {
throw new ZendT_Exception_Error('Para executar esse procedimento e preciso chamar os métodos startDocument e addContent ');
}
if ($this->_output == 'pdf') {
$client = new Zend_Http_Client($this->_uriPhp . 'wsPrintServer/Pdf.php?IdDocument=' . $this->_idDocument, array('timeout' => 10 * 60));
$response = $client->request();
$pdf = $response->getBody();
$pos = strpos($pdf, '%PDF');
if (!$pos) {
$pos = 0;
}
return substr($pdf, $pos);
} elseif ($this->_output == 'raw') {
$client = new Zend_Http_Client($this->_uriPhp . 'wsPrintServer/Raw.php?IdDocument=' . $this->_idDocument, array('timeout' => 10 * 60));
$response = $client->request();
return $response->getBody();
} else {
$param = array();
$param['pIdDocument'] = $this->_idDocument;
$result = $this->_client->EndDocument($param);
if ($result->EndDocumentResult->ErrorCode) {
throw new ZendT_Exception_Error('(' . $result->EndDocumentResult->ErrorCode . ') :: ' . $result->EndDocumentResult->ErrorMessage . ' :: Erro ao iniciar processo de impressão. ');
} else {
return true;
}
}
}
示例15: __construct
/**
* Constructor
*
* @param string $wsdl
* @param array $options
*/
public function __construct($wsdl = null, $options = null)
{
// Use SOAP 1.1 as default
$this->setSoapVersion(SOAP_1_1);
parent::__construct($wsdl, $options);
}