Example #1
0
        private string SubmitSoapServiceRequest(string xmlRequest, CredentialsProvider credentials)
        {
            /* NOTE:
             * This code is intended to be used for reference only and it
             * may not return any response or meaningful response during
             * the execution of the program.  Appropriate code change needs
             * to be made to work with your specific SOAP based service provider.
             */

            MohawkTransportLayer transportLayer = new MohawkTransportLayer();

            RequestMessage requestMessage = null;

            try
            {
                requestMessage = SimpleRequestMessage.Create(new DocumentFactory().CreateFromString(xmlRequest));
            }
            catch (TransportLayerException e)
            {
                Console.WriteLine(e.StackTrace);
            }
            String xmlResponse = transportLayer.SendRequestAndGetResponse(credentials, requestMessage);

            return(xmlResponse);
        }
		void Handle(SimpleRequestMessage message)
		{
			_bus.MessageContext<SimpleRequestMessage>()
				.Respond(new SimpleResponseMessage(message.CorrelationId));

			if (_requestCounter == _repeatCount)
				_handlerComplete.Set();
		}
Example #3
0
        void Handle(SimpleRequestMessage message)
        {
            _bus.MessageContext <SimpleRequestMessage>()
            .Respond(new SimpleResponseMessage(message.CorrelationId));

            if (_requestCounter == _repeatCount)
            {
                _handlerComplete.Set();
            }
        }
Example #4
0
        public virtual void ShouldRun()
        {
            var transportLayer = new MohawkTransportLayer();

            var credentialsProvider = new _CredentialsProvider_35();

            var requestMessage
                = SimpleRequestMessage.Create(new DocumentFactory().CreateFromStream(Platform.ResourceLoader.GetResource
                                                                                         (typeof(MohawkSender), "findCandidatesQuery.xml")));

            string response = transportLayer.SendRequestAndGetResponse(credentialsProvider, requestMessage);

            Console.Out.WriteLine(response);
        }
Example #5
0
        private string SubmitRestServiceRequest(string xmlRequest, CredentialsProvider credentials)
        {
            /* NOTE:
             * This code is intended to be used for reference only and it
             * may not return any response or meaningful response during
             * the execution of the program.  Appropriate code change needs
             * to be made to work with your specific REST based service provider.
             */

            string serviceURL = "http://tl7.intelliware.ca/rest";

            string xmlResponse = new RestTransportLayer(serviceURL).SendRequestAndGetResponse(
                credentials, SimpleRequestMessage.Create(xmlRequest));

            return(xmlResponse);
        }
Example #6
0
        /// <summary>
        /// 构建请求消息模型
        /// </summary>
        /// <param name="service"></param>
        /// <param name="method"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        private SimpleRequestMessage BuildRequestMessage(string service, string method, params object[] args)
        {
            SimpleRequestMessage requestMessage = new SimpleRequestMessage
            {
                ClientName  = clientName,
                ServerName  = serverName,
                ServiceName = service,
                MethodName  = method,
                MessageID   = Guid.NewGuid().ToString(),
            };

            if (args != null && args.Any())
            {
                requestMessage.Parameters = args.Select(arg =>
                {
                    var simpleParameter = new SimpleParameter {
                        Value = typeCodec.EnCode(arg, out int codeType), ValueType = codeType
                    };
                    return(simpleParameter);
                }).ToArray();
            }
            return(requestMessage);
        }
Example #7
0
        public virtual void ShouldMapToCorrectService()
        {
            var method = transport.CreatePostMethod(SimpleRequestMessage.Create("<REPC_IN000012CA></REPC_IN000012CA>"));

            Assert.AreEqual(new Uri("http://142.222.45.132:8080/soap/hl7/v3/ca/v2.04.2/Service.svc/", true), method.Uri, "url");
        }
Example #8
0
 private RequestMessage CreateMessage()
 {
     return(SimpleRequestMessage.Create("<myXml></myXml>"));
 }