Skip to content

Instantly share code, notes, and snippets.

@kareypowell
Last active October 23, 2015 07:55
Show Gist options
  • Save kareypowell/000af161df824e9d5ea2 to your computer and use it in GitHub Desktop.
Save kareypowell/000af161df824e9d5ea2 to your computer and use it in GitHub Desktop.
SendEMailWSService.php
<?php
namespace SendEMailWSService {
/**
* @property boolean $error
* @property string $message
*/
class result {
public $error;
public $message;
}
/**
* @property string $emailXML
*/
class sendMail {
public $emailXML;
}
/**
* @property result $return
*/
class sendMailResponse {
public $return;
}
/**
* SendEMailWSService class
*
*
*
* @author {author}
* @copyright {copyright}
* @package {package}
*/
class SendEMailWSService extends \SoapClient {
public static $headerName;
public static $headerValue;
private static $uri = '';
private static $classmap = array(
'result' => 'SendEMailWSService\result',
'sendMail' => 'SendEMailWSService\sendMail',
'sendMailResponse' => 'SendEMailWSService\sendMailResponse',
);
public function __construct($wsdl = "", $options = array()) {
if (is_array($options)) {
$defOpt = array(
'exceptions' => 1,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS | SOAP_USE_XSI_ARRAY_TYPE,
'typemap' => array(
array(
'type_ns' => 'http://www.w3.org/2001/XMLSchema',
'type_name' => 'long',
'to_xml' => 'to_long_xml',
'from_xml' => 'from_long_xml',
)
)
);
$options = array_merge($defOpt,$options);
}
foreach(self::$classmap as $key => $value) {
if(!isset($options['classmap'][$key])) {
$options['classmap'][$key] = $value;
}
}
parent::__construct($wsdl, $options);
// setup special soap headers
if (!empty(self::$headerName)) {
$this->__setSoapHeaders(array(
new \SoapHeader('SendEMailWSService', self::$headerName, self::$headerValue, false)
));
}
}
/**
*
*
* @param sendMail $parameters
* @return sendMailResponse
*/
public function sendMail(sendMail $parameters) {
return $this->__soapCall('sendMail', array($parameters), array(
'uri' => self::$uri,
'soapaction' => ''
)
);
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment