Example #1
0
        public void SerializeToXml()
        {
            var osa = new WcfSapAdapter.Outbound(
                a => {
                a.Address = new SAPConnectionUri {
                    ApplicationServerHost = "appHost",
                    ConnectionType        = OutboundConnectionType.A,
                    MsServ   = "msServer",
                    Group    = "dialog",
                    Client   = "100",
                    Language = "FR"
                };
                a.AutoConfirmSentIdocs    = true;
                a.MaxConnectionsPerSystem = 30;
                a.SendTimeout             = TimeSpan.FromMinutes(2);
                a.Password = "******";
                a.UserName = "******";
                a.MaxConnectionsPerSystem = 30;
            });
            var xml = ((IAdapterBindingSerializerFactory)osa).GetAdapterBindingSerializer().Serialize();

            Assert.That(
                xml,
                Is.EqualTo(
                    "<CustomProps>" +
                    "<BindingType vt=\"8\">sapBinding</BindingType>" +
                    "<BindingConfiguration vt=\"8\">" +
                    "&lt;binding name=\"sapBinding\" sendTimeout=\"00:02:00\" enableBizTalkCompatibilityMode=\"true\" maxConnectionsPerSystem=\"30\" autoConfirmSentIdocs=\"true\" /&gt;" +
                    "</BindingConfiguration>" +
                    "<EndpointBehaviorConfiguration vt=\"8\">&lt;behavior name=\"EndpointBehavior\" /&gt;" + "</EndpointBehaviorConfiguration>" +
                    "<UseSSO vt=\"11\">0</UseSSO>" +
                    "<UserName vt=\"8\">BTS_USER</UserName>" +
                    "<Password vt=\"8\">p@ssw0rd</Password>" +
                    "<InboundBodyLocation vt=\"8\">UseBodyElement</InboundBodyLocation>" +
                    "<InboundNodeEncoding vt=\"8\">Xml</InboundNodeEncoding>" +
                    "<OutboundBodyLocation vt=\"8\">UseBodyElement</OutboundBodyLocation>" +
                    "<OutboundXmlTemplate vt=\"8\">&lt;bts-msg-body xmlns=\"http://www.microsoft.com/schemas/bts2007\" encoding=\"xml\"/&gt;</OutboundXmlTemplate>" +
                    "<PropagateFaultMessage vt=\"11\">-1</PropagateFaultMessage>" +
                    "<EnableTransaction vt=\"11\">0</EnableTransaction>" +
                    "<IsolationLevel vt=\"8\">Serializable</IsolationLevel>" +
                    "</CustomProps>"));
        }
Example #2
0
        public void ValidateDoesNotThrow()
        {
            var osa = new WcfSapAdapter.Outbound(
                a => {
                a.Address = new SAPConnectionUri {
                    ApplicationServerHost = "appHost",
                    ConnectionType        = OutboundConnectionType.A,
                    MsServ   = "msServer",
                    Group    = "dialog",
                    Client   = "100",
                    Language = "FR"
                };
                a.AutoConfirmSentIdocs    = true;
                a.MaxConnectionsPerSystem = 30;
                a.Password = "******";
                a.UserName = "******";
                a.MaxConnectionsPerSystem = 30;
            });

            Assert.That(() => ((ISupportValidation)osa).Validate(), Throws.Nothing);
        }