我写了这样的函数:
/**
* Send the soap request to complemar
* @method SendSoapRequest
* @param string $method The requst action
* @param string $requestData The xml
* @access private
*/
private function SOAPRequest( $method, $requestData ){
/** Run the soap request */
$result = $this->SOAPClient->call( $method, $requestData, 'xsi' );
/** Now check if there are errors or faults */
if( $this->SOAPClient->fault ){
/** Save the fault to the last fault message */
$this->SOAPLastFault = print_r( $result, true );
/** Output the error */
echo '<h2>Fault</h2><pre>'.$this->SOAPLastFault.'</pre>';
/** Return false */
return false;
} else {
/** Check soap for erros */
$this->SOAPErrors = $this->SOAPClient->getError();
/** Check soaps return for a message */
if( $this->SOAPErrors ){
/** we have an error output it */
echo '<h2>Error</h2><pre>' . $error . '</pre>';
/** return false */
return false;
}
}
/** No errors return the result */
return $result;
}
我正在尝试发送上面已经构建的soap请求,将请求带回另一个文件并在db中设置它。我对我应该尝试的事感到困惑。
我想写下发送和返回的文件在下面。
class ComplemarUpdateOrderStatus extends \Framework\Event\Cronjob
{
protected static $prefix = "[ComplemarUpdateOrderStatus]: ";
public static function run( data ){
/** Log that we started */
self::logMessage("Started!");
}
{
}
我应该SoapClient::__doRequest
???
任何帮助将不胜感激。我很困惑。