本文整理汇总了PHP中SoapClient::__getLastRequestHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::__getLastRequestHeaders方法的具体用法?PHP SoapClient::__getLastRequestHeaders怎么用?PHP SoapClient::__getLastRequestHeaders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::__getLastRequestHeaders方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: requestDebug
public function requestDebug()
{
echo "Last Request:\n\n";
echo $this->client->__getLastRequestHeaders() . "\n\n";
echo self::tidyit($this->client->__getLastRequest()) . "\n\n";
echo $this->client->__getLastResponseHeaders() . "\n\n";
echo self::tidyit($this->client->__getLastResponse()) . "\n";
}
示例2: GetRegZavod
public static function GetRegZavod()
{
$debug = false;
$wsdl_url = dirname(__FILE__) . '/RegZavodServicePort.wsdl';
if (!file_exists($wsdl_url)) {
echo 'Missing WSDL shema for RegZavodServicePort.wsdl', "\n";
echo 'WSDL PATH: ', $wsdl_url, "\n";
die;
}
$client = new SoapClient($wsdl_url, array('exceptions' => 0, 'trace' => 1, 'user_agent' => 'Bober'));
$result = $client->__soapCall('getRegZavod', array());
if ($debug) {
var_dump($client->__getFunctions());
echo 'REQUEST HEADERS:', "\n", $client->__getLastRequestHeaders(), "\n";
echo 'REQUEST:', "\n", $client->__getLastRequest(), "\n";
var_dump($result);
if (is_soap_fault($result)) {
trigger_error('SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})', E_USER_ERROR);
}
print_r($result);
}
if ($result != '' && !is_soap_fault($result)) {
$result = json_decode(json_encode($result), true);
return $result;
} else {
return array();
}
}
示例3: getLastRequestHeaders
/**
* Retrieve request headers
*
* @return string
*/
public function getLastRequestHeaders()
{
if ($this->_soapClient !== null) {
return $this->_soapClient->__getLastRequestHeaders();
}
return '';
}
示例4: dumpSoapMessages
/**
* Dump Client response and request messages
*
* @param SoapClient $client Client instance
*
* @return void
*/
private function dumpSoapMessages($client)
{
echo '<br />$client->__getLastRequest():<br />';
var_dump($client->__getLastRequest());
echo '<br />$client->__getLastRequestHeaders():<br />';
var_dump($client->__getLastRequestHeaders());
echo '<br />$client->__getLastResponse():<br />';
var_dump($client->__getLastResponse());
echo '<br />$client->__getLastResponseHeaders():<br />';
var_dump($client->__getLastResponseHeaders());
}
示例5: send
/**
* @param array $data
* @param bool|false $returnXml
*
* @return \stdClass|array|string
*
* @throws WebGateException
*/
public function send($data, $returnXml = false)
{
try {
$options = ['trace' => true, 'exceptions' => true, 'connection_timeout' => $this->connectionTimeout];
if (!empty($this->login)) {
$options['login'] = $this->login;
$options['password'] = $this->password;
}
if (0) {
$options['location'] = '';
$options['uri'] = '';
$wsdl = null;
} else {
$wsdl = $this->wsdlPath;
}
$client = new \SoapClient($wsdl, $options);
ini_set("default_socket_timeout", $this->connectionTimeout);
$response = $client->__soapCall($this->methodName, array('params' => $data));
$this->logger->addDebug('Response XML: ' . PHP_EOL . $client->__getLastResponse());
$this->logger->addDebug('Response JSON: ' . PHP_EOL . json_encode($response));
return $returnXml ? $client->__getLastResponse() : $response;
} catch (\SoapFault $e) {
if (isset($client)) {
$this->logger->addDebug(PHP_EOL . __METHOD__ . ':');
$this->logger->addDebug('Request Headers: ' . $client->__getLastRequestHeaders());
$this->logger->addDebug('Request: ' . $client->__getLastRequest());
$this->logger->addDebug('Response Headers: ' . $client->__getLastResponseHeaders());
$this->logger->addDebug('Response: ' . PHP_EOL . $client->__getLastResponse());
}
if ($e->getCode()) {
$code = $e->getCode();
} else {
$code = isset($e->faultcode) && is_numeric($e->faultcode) ? $e->faultcode : 500;
}
$this->logger->addCritical(PHP_EOL . __METHOD__ . sprintf('[%s/%s] %s', $e->getCode(), $code, $e->getMessage()));
throw new WebGateException($e->getMessage(), $code, $e);
}
}
示例6: invoke
/**
* Invoke method call
*
* @param string method name
* @param var vars
* @return var answer
* @throws webservices.soap.SOAPFaultException
*/
public function invoke()
{
$args = func_get_args();
$method = array_shift($args);
$options = ['encoding' => $this->getEncoding(), 'exceptions' => 0, 'trace' => $this->cat != null, 'user_agent' => 'XP-Framework/' . get_class($this)];
if (null !== $this->ctimeout) {
$options['connection_timeout'] = $this->ctimeout;
}
if (null !== $this->timeout) {
// NOOP
}
if (null !== $this->endpoint->getUser()) {
$options['login'] = $this->endpoint->getUser();
}
if (null !== $this->endpoint->getPassword()) {
$options['password'] = $this->endpoint->getPassword();
}
if (sizeof($this->map)) {
$options['classmap'] = $this->map;
}
$this->version && ($options['soap_version'] = $this->version);
$this->location && ($options['location'] = $this->location);
if ($this->wsdl) {
$client = new \SoapClient($this->endpoint->getURL(), $options);
} else {
// Do not overwrite location if already set from outside
isset($options['location']) || ($options['location'] = $this->endpoint->getURL());
// Assert we have a uri
if (!$this->uri) {
throw new \lang\IllegalArgumentException('SOAP uri required in non-wsdl mode.');
}
$options['uri'] = $this->uri;
$options['style'] = $this->getStyle();
$options['use'] = $this->getSoapEncoding();
$client = new \SoapClient(null, $options);
}
// Take care of wrapping XP SOAP types into respective ext/soap value objects
$result = $client->__soapCall($method, $this->checkParams($args));
$this->cat && $this->cat->debug('>>>', $client->__getLastRequestHeaders(), $client->__getLastRequest());
$this->cat && $this->cat->debug('<<<', $client->__getLastResponseHeaders(), $client->__getLastResponse());
if (is_soap_fault($result)) {
throw new SOAPFaultException(new CommonSoapFault($result->faultcode, $result->faultstring));
}
return $result;
}
示例7: SoapClient
// This method allows us to capture the original SoapClient
// instance for debugging. (we will check the last request
// made by SoapClient any time we see an exception!)
$soapClient = new SoapClient(SoapAsendiaWebApiClient::TESTING_WSDL, ['trace' => 1]);
$wsdlClient = new AsendiaWsdlClientImpl($soapClient);
$asendia = new SoapAsendiaWebApiClient($wsdlClient, $login, $password);
try {
printf("Creating a shipment.\n");
$createdShipment = $asendia->createShipment();
printf(" * shipment number: %s\n", $createdShipment->getShipment());
printf(" * status: %s\n", $createdShipment->getStatus());
printf("\n");
} catch (Error $e) {
printf(" * ERROR: %s\n\n", $e->getMessage());
if ($soapClient) {
print_r($soapClient->__getLastRequestHeaders());
print_r($soapClient->__getLastRequest());
}
throw $e;
}
try {
printf("Adding packages to a shipment.\n");
$manifest = get_manifest_from_facade($randomize = true);
$addedShipmentPackages = $asendia->addPackagesToShipment($createdShipment->getShipment(), $manifest, $labelType);
printf(" * shipment number: %s\n", $addedShipmentPackages->getShipment());
foreach ($addedShipmentPackages->getPackages() as $package) {
printf(" * Added package\n");
printf(" * PckId: %s\n", $package->getPckId());
printf(" * LabelFile: %s\n", $package->getLabelFile());
printf("\n");
}
示例8: SoapHeader
/*$headers = array();
$headers[] = new SoapHeader('http://www.topcall.com/2005/solution.wsdl',
'SendSimpleMessage',
array('Service'=>'', 'Number' => '1234', 'Subject'=>'', 'Text' => '121212'));
*/
try {
$result = $client->SendSimpleMessage(array('Service'=>"test string",'Number'=> "1234",'Subject'=>"234234",'Text'=>"dfgdfgdfg"));
//$result = $client->__soapCall("SendSimpleMessage", array('bbb', '12345','aaa' ,'tresctresce'));
echo "Response:\n" . $client->__getLastRequest() . "\n";
echo "Response:\n" . $client->__getLastRequestHeaders() . "\n";
echo "Response:\n" . $client->__getLastResponseHeaders() . "\n";
echo "Response:\n" . $client->__getLastResponse();
print_r($result);
}
catch (SoapFault $soapFault) {
var_dump($soapFault);
echo "Response:\n" . $client->__getLastRequest() . "\n";
echo "Response:\n" . $client->__getLastRequestHeaders() . "\n";
echo "Response:\n" . $client->__getLastResponseHeaders() . "\n";
var_dump($client->__getFunctions());
示例9: getLastRequestHeaders
/**
* returns last request headers
*
* @return string
*/
public function getLastRequestHeaders()
{
return $this->soapClient->__getLastRequestHeaders();
}
示例10: array
$response = array();
//$response['helloResponse'] = $client->getHello();
$response['goodbyeResponse'] = $client->getGoodbye();
//print_r($response);
} catch (SoapFault $fault) {
echo "<pre style='margin:2em;color:red'>";
print_r($fault);
//echo 'Soap Error - faultcode: '.$fault->faultcode.' faultstring: '.$fault->faultstring;
echo "</pre>";
}
echo '<hr>';
echo "<pre style='margin:2em;color:black;'>";
echo 'Reponse <br>';
var_dump($response);
echo '</pre>';
echo '<hr>';
echo "<pre style='margin:2em;font-family:\"Courier New\",Courier,monospace;line-height:1em'>";
echo 'Soap Client trace' . "\n";
echo "REQUEST:" . $client->__getLastRequest() . "\n";
echo "RESPONSE:" . $client->__getLastResponse() . "\n";
echo "REQUEST HEADERS:" . $client->__getLastRequestHeaders();
echo "RESPONSE HEADERS:" . $client->__getLastResponseHeaders();
echo 'Debug Report <br>';
echo '</pre>';
//Notice: Array to string conversion in F:\bit5411\apps\gjsoap\htdocs\includes\gj_utility.inc.php on line 341
//fix above
generateDebugReport('browser', get_defined_vars());
?>
示例11: __getLastRequestHeaders
/**
* @link http://php.net/manual/en/soapclient.getlastrequestheaders.php
*
* @return string
*/
public function __getLastRequestHeaders()
{
return parent::__getLastRequestHeaders();
}
示例12: parseXmlResponse
//body
foreach ($children as $child) {
//GetTaxiInfosResponse
foreach ($child->children() as $x) {
//taxi info
echo $x->TaxiInfo->LicenseNum;
echo $x->TaxiInfo->LicenseDate;
}
}
}
var_dump($response_head);
echo '<pre/>';
echo '<h2>Request</h2>';
echo '<pre>';
$request = $client->__getLastRequest();
$request_head = $client->__getLastRequestHeaders();
$xml = simplexml_load_string($request);
//echo $xml->asXML();
//$children = $xml->children('http://dtis.mos.ru/taxi');
echo htmlentities($request);
var_dump($request);
var_dump($request_head);
echo '<pre/>';
echo '<pre>';
var_dump($result);
echo '<pre/>';
} catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
function parseXmlResponse($response)
{
示例13: getLastRequest
/**
* @return array
*/
public function getLastRequest()
{
return array('request' => array('header' => $this->soapClient->__getLastRequestHeaders(), 'body' => $this->soapClient->__getLastRequest()), 'response' => array('header' => $this->soapClient->__getLastResponseHeaders(), 'body' => $this->soapClient->__getLastResponse()));
}
示例14: SoapClient
<?php
ini_set('soap.wsdl_cache_enabled', '0');
require_once 'config.php';
$client = new SoapClient("http://process.localhost/process.wsdl.php");
//, array('trace' => 1));
try {
$uri = 'http://localhost/sample.3gp';
$callback = 'http://localhost/process_callback.php?ref=123';
//will tell client app that file "123" finished processing
$watermark_uri = 'http://localhost/watermark.png';
$result = $client->fetchAndConvert('username', 'password', $uri, $callback, $watermark_uri);
if (!$result) {
echo 'Failed to add order!';
} else {
echo 'Order added successfully. Order ID is ' . $result;
}
} catch (Exception $e) {
echo 'Exception: ' . $e . '<br/><br/>';
echo 'Request header: ' . htmlspecialchars($client->__getLastRequestHeaders()) . '<br/>';
echo 'Request: ' . htmlspecialchars($client->__getLastRequest()) . '<br/>';
echo 'Response: ' . htmlspecialchars($client->__getLastResponse()) . '<br/>';
}
示例15: SoapClient
<?php
$client = new SoapClient("http://sparesprit.de/sprit.wsdl", array('location' => "http://sparesprit.de/server.php", 'uri' => "http://localhost", 'trace' => 1));
try {
$result = $client->__soapCall("getCoordsByTown", array("town" => "Leipzig"));
//echo $result;
echo gettype($result);
} catch (Exception $e) {
echo 'Exception abgefangen: ', $e->getMessage(), "\n";
}
echo "\nReturning value of __soapCall() call: " . $return;
echo "\nDumping request headers:\n" . $client->__getLastRequestHeaders();
echo "\nDumping request:\n" . $client->__getLastRequest();
echo "\nDumping response headers:\n" . $client->__getLastResponseHeaders();
echo "\nDumping response:\n" . $client->__getLastResponse();