public NotifyOperationResult SendNotification(NotificationEvent notificationEvent, out int returnStatus) { returnStatus = 0; NotifyOperationResult result; try { string[] _gatewayParams = notificationEvent.NotificationChannelInfo.ChannelBaseParameters.Split(new char[] { '|' }); if (MSMQHELPER.sendMQMessage(_gatewayParams[0], _gatewayParams[1], new string[] { notificationEvent.NotificationDestination, notificationEvent.NotificationMessageSubject, "http://sfexpand.SMSConnector.SMSConnectorSF.softfinanca.com/" })) { result = NotifyOperationResult.Success; } else { result = NotifyOperationResult.Error; } } catch { result = NotifyOperationResult.Error; } return(result); }
public static bool sendMQMessage(string msmqMachine, string msmqPath, string[] msmqSMSMSG) { MessageQueue _mq = null; Message mMSG = null; bool result; try { _mq = MSMQHELPER.GetPrivateQueue(msmqMachine, msmqPath); if (null == _mq) { result = false; } else { mMSG = new Message(); mMSG.BodyStream = MSMQHELPER.SerializeMessage(msmqSMSMSG); _mq.Send(mMSG); result = true; } } catch { result = false; } finally { if (_mq != null) { _mq.Close(); _mq.Dispose(); _mq = null; } if (mMSG != null) { mMSG.Dispose(); mMSG = null; } } return(result); }