本文整理汇总了PHP中Zend_Soap_Client::getPDFLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Soap_Client::getPDFLabel方法的具体用法?PHP Zend_Soap_Client::getPDFLabel怎么用?PHP Zend_Soap_Client::getPDFLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Soap_Client
的用法示例。
在下文中一共展示了Zend_Soap_Client::getPDFLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soapCall
public function soapCall($xml)
{
$wsdl = Mage::getStoreConfig('shipping/wgtntpro/wsdl');
$client = new Zend_Soap_Client($wsdl, array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_1));
$temp = new stdClass();
$temp->inputXml = $xml;
try {
$response = $client->getPDFLabel($temp);
#chiamata soap
$response_xml = new SimpleXMLElement($response->getPDFLabelReturn->outputString);
//$documentCorrect = $response->getPDFLabelReturn->documentCorrect;
if (isset($response_xml->Complete)) {
$ret = true;
} else {
$ret = (string) $response_xml->Incomplete->RuntimeError->Message . (string) $response_xml->Complete->WarningMessage;
}
} catch (Exception $e) {
$ret = Mage::helper('wgtntpro')->__('WGTNT PRO: Soal Call Failed');
}
return $ret;
}
示例2: before
public function before($observer)
{
$debug = $this->_getDebugConfig();
Mage::log("Called " . __METHOD__, null, self::LOGFILE, $debug);
$obj = $observer->getDataObject();
if ($obj) {
$params = Mage::app()->getRequest()->getParam('wgtntpro');
Mage::log("Request params: " . PHP_EOL . print_r($params, true), null, self::LOGFILE, $debug);
if (isset($params['usalo'])) {
#modulo usato
$documentCorrect = False;
/** @var Webgriffe_Tntpro_Helper_Data $helper */
$helper = Mage::helper('wgtntpro');
$msg = $helper->__('Tnt failed.');
$magazzino_default = Mage::getModel('wgtntpro/magazzini');
$magazzino_default->loadDefault();
/** @var Webgriffe_Tntpro_Model_Magazzini $magazzino */
$magazzino = Mage::getModel('wgtntpro/magazzini')->load($params['magazzino']);
$countryTo = $obj->getOrder()->getShippingAddress()->getCountryId();
$b_domestic = $magazzino->getCountry() == $countryTo || 'IT' == $magazzino->getCountry() && ('SM' == $countryTo || 'VA' == $countryTo);
//caso speciale san marino/vatican city da italia
Mage::log(PHP_EOL . '$magazzino_default ' . print_r($magazzino_default->debug(), true), null, self::LOGFILE, $debug);
Mage::log(PHP_EOL . '$magazzino ' . print_r($magazzino->debug(), true), null, self::LOGFILE, $debug);
$xml = $helper->generateXml($obj, $magazzino_default, $magazzino, $params, $b_domestic);
if ($debug) {
if (!$helper->thisTest()) {
Mage::throwException($helper->__('Tnt TEST failed.'));
} else {
Mage::getSingleton('adminhtml/session')->addSuccess('<pre>' . htmlspecialchars($xml) . '</pre>');
}
}
#PARTE SOAP
$wsdl = Mage::getStoreConfig('shipping/wgtntpro/wsdl');
Mage::log("Start logging soap call to {$wsdl}", null, self::LOGFILE, $debug);
$client = new Zend_Soap_Client($wsdl, array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_1));
$temp = new stdClass();
$temp->inputXml = $xml;
Mage::log("XML request body: " . PHP_EOL . $xml, null, self::LOGFILE, $debug);
try {
/** @var DOMDocument $response */
$response = $client->getPDFLabel($temp);
#chiamata soap
$response_xml = new SimpleXMLElement($response->getPDFLabelReturn->outputString);
Mage::log("XML response body: " . PHP_EOL . print_r($response, true), null, self::LOGFILE, $debug);
$documentCorrect = $response->getPDFLabelReturn->documentCorrect;
} catch (Exception $e) {
Mage::log("Something went wrong while performing soap call: " . $e->getMessage(), null, self::LOGFILE, $debug);
$response = false;
}
#FINE PARTE SOAP
if (False !== $response) {
Mage::getModel('wgtntpro/consignmentno')->store($response, $params['magazzino'], $b_domestic);
if ($debug) {
$dom = new DOMDocument('1.0');
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$dom->loadXML($response_xml->asXML());
Mage::getSingleton('adminhtml/session')->addSuccess('<hr /><pre>' . htmlspecialchars($dom->saveXML()) . '</pre>');
}
if ($documentCorrect) {
$obj->setShippingLabel($response->getPDFLabelReturn->binaryDocument);
Mage::app()->getRequest()->setParam('tracking_tnt', $response_xml->Complete->TNTConNo);
#verranno poi usati nell'after
} else {
#imposto l'errore dell'xml
/*Mage::getSingleton('adminhtml/session')->getData('messages')->clear();*/
Mage::throwException('TNT PRO: ' . $response_xml->Incomplete->RuntimeError . ' ' . $response_xml->Incomplete->RuntimeError->Message . ' ' . $response_xml->Incomplete->Message);
}
} else {
Mage::getSingleton('adminhtml/session')->getData('messages')->clear();
Mage::throwException($helper->__('TNT PRO: Connection error to webservice'));
}
} else {
#modulo non usato
}
}
#Mage::throwException('TNT PRO: modalità di sviluppo');
return $this;
}