Пример #1
0
    public static void MessageHeader_ResponseTypeWithUsesMessageHeaderAttribute()
    {
        // *** SETUP *** \\
        var binding         = new BasicHttpBinding();
        var endpointAddress = new EndpointAddress(Endpoints.HttpBaseAddress_Basic_Text);
        var factory         = new ChannelFactory <IXmlMessageContarctTestService>(binding, endpointAddress);
        IXmlMessageContarctTestService serviceProxy = factory.CreateChannel();
        var input = new XmlMessageContractTestRequest("1");

        try
        {
            // *** EXECUTE *** \\
            XmlMessageContractTestResponse response = serviceProxy.EchoMessageResponseWithMessageHeader(input);

            // *** VALIDATE *** \\
            Assert.NotNull(response);
            Assert.Equal(input.Message, response.Message);
        }
        finally
        {
            // *** ENSURE CLEANUP *** \\
            ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory);
        }
    }
Пример #2
0
    public static void MessageHeader_ResponseTypeWithUsesMessageHeaderAttribute()
    {
        // *** SETUP *** \\
        var binding = new BasicHttpBinding();
        var endpointAddress = new EndpointAddress(Endpoints.HttpBaseAddress_Basic);
        var factory = new ChannelFactory<IXmlMessageContarctTestService>(binding, endpointAddress);
        IXmlMessageContarctTestService serviceProxy = factory.CreateChannel();
        var input = new XmlMessageContractTestRequest("1");

        try
        {
            // *** EXECUTE *** \\
            XmlMessageContractTestResponse response = serviceProxy.EchoMessageResponseWithMessageHeader(input);

            // *** VALIDATE *** \\
            Assert.NotNull(response);
            Assert.Equal(input.Message, response.Message);
        }
        finally
        {
            // *** ENSURE CLEANUP *** \\
            ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy, factory);
        }
    }
Пример #3
0
        public XmlMessageContractTestResponse EchoMessageResponseWithMessageHeader(XmlMessageContractTestRequest request)
        {
            var result = new XmlMessageContractTestResponse(request.Message);

            return(result);
        }
Пример #4
0
 public XmlMessageContractTestResponse EchoMessageResponseWithMessageHeader(XmlMessageContractTestRequest request)
 {
     var result = new XmlMessageContractTestResponse(request.Message);
     return result;
 }