public int SendMessageForMsgID(string message, string MQName, out string msgId) { msgId = string.Empty; if ((address != null) && (Binding != null)) { using (ChannelFactory <ISendMessageService> channel = new ChannelFactory <ISendMessageService>(Binding, address)) { ISendMessageService service = channel.CreateChannel(); return(service.SendMessageForMsgID(message, MQName, out msgId)); } } else { return(-1); } }