public override XdsResponseDocument ExecuteXmlDataManager(XdsRequestDocument requestDocument) {
            var adapter = XmlDataTool.ResolveXmlDataManagerAdapter(ProductName);
            var requestBytes = adapter.RequestSerializer.Serialize(requestDocument);

            using(var xdsProxy = new XmlDataServiceClient()) {
                var responseBytes = xdsProxy.Execute(requestBytes, ProductName, false);
                return adapter.ResponseSerializer.Deserialize(responseBytes);
            }
        }
Пример #2
0
        public override XdsResponseDocument ExecuteXmlDataManager(XdsRequestDocument requestDocument)
        {
            var adapter      = XmlDataTool.ResolveXmlDataManagerAdapter(ProductName);
            var requestBytes = adapter.RequestSerializer.Serialize(requestDocument);

            using (var xdsProxy = new XmlDataServiceClient()) {
                var responseBytes = xdsProxy.Execute(requestBytes, ProductName, false);
                return(adapter.ResponseSerializer.Deserialize(responseBytes));
            }
        }
        private static void VerifyXmlDataService(XdsRequestDocument xdsRequest, string productName, bool? compress,
                                                 bool? security) {
            using(var xdsProxy = new XmlDataServiceClient()) {
                var serializer = GetSerializer(compress, security);
                var requestBytes = serializer.Serialize(xdsRequest.ConvertToBytes());

                var responseBytes = security.GetValueOrDefault(false)
                                        ? xdsProxy.ExecuteSecurity(requestBytes, productName, compress.GetValueOrDefault(false))
                                        : xdsProxy.Execute(requestBytes, productName, compress.GetValueOrDefault(false));

                Assert.IsNotNull(responseBytes);

                var xdsResponse = ((byte[])serializer.Deserialize(responseBytes)).ConvertToXdsResponseDocument();

                Assert.IsNotNull(xdsResponse);
                Assert.IsFalse(xdsResponse.HasError);

                Assert.IsTrue(xdsResponse.Responses.Count > 0);
            }
        }
Пример #4
0
        private static void VerifyXmlDataService(XdsRequestDocument xdsRequest, string productName, bool?compress,
                                                 bool?security)
        {
            using (var xdsProxy = new XmlDataServiceClient()) {
                var serializer   = GetSerializer(compress, security);
                var requestBytes = serializer.Serialize(xdsRequest.ConvertToBytes());

                var responseBytes = security.GetValueOrDefault(false)
                                        ? xdsProxy.ExecuteSecurity(requestBytes, productName, compress.GetValueOrDefault(false))
                                        : xdsProxy.Execute(requestBytes, productName, compress.GetValueOrDefault(false));

                Assert.IsNotNull(responseBytes);

                var xdsResponse = ((byte[])serializer.Deserialize(responseBytes)).ConvertToXdsResponseDocument();

                Assert.IsNotNull(xdsResponse);
                Assert.IsFalse(xdsResponse.HasError);

                Assert.IsTrue(xdsResponse.Responses.Count > 0);
            }
        }