Created
July 25, 2011 09:30
-
-
Save pepe84/1103822 to your computer and use it in GitHub Desktop.
PHP Zend: My SoapClient resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
; SOAP configuration | |
resources.mysoapclient.wsdl = "routetowsdlfile/mysoap.wsdl" | |
resources.mysoapclient.options.encoding = "UTF-8" | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
/** | |
* Initialize SoapClient | |
*/ | |
public function _initMySoapClient() | |
{ | |
$options = $this->getOptions(); | |
// Load SoapClient WSDL file | |
/** @todo Read file path! **/ | |
$wsdl = $options['resources']['mysoapclient']['wsdl']; | |
// Load SoapClient options | |
$options = $options['resources']['mysoapclient']['options']; | |
return new Zend_Soap_Client($wsdl, $options); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class My_Zend_Soap_Client | |
{ | |
/** | |
* Constructor | |
* | |
* @param string $wsdl | |
* @param array $options | |
*/ | |
public function __construct($wsdl = null, $options = null) | |
{ | |
parent::__construct($wsdl, $options); | |
// Init custom PHP SoapClient | |
include_once 'routetolib/MySoapClient.php' | |
$this->setSoapClient(new MySoapClient($wsdl, $options)); | |
} | |
/** | |
* Perform result pre-processing | |
* | |
* @param array $arguments | |
*/ | |
protected function _preProcessResult($result) | |
{ | |
return utf8_decode($result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment