public void SerializeToXml() { var isa = new WcfSqlAdapter.Inbound( a => { a.Address = new SqlAdapterConnectionUri { InboundId = "AvailableBatches", Server = "localhost", InitialCatalog = "BizTalkFactoryTransientStateDb" }; a.InboundOperationType = InboundOperation.XmlPolling; a.PolledDataAvailableStatement = "SELECT COUNT(1) FROM vw_claim_AvailableTokens"; a.PollingStatement = "EXEC usp_claim_CheckOut"; a.PollingInterval = TimeSpan.FromHours(2); a.InboundBodyLocation = InboundMessageBodySelection.UseBodyPath; a.InboundBodyPathExpression = "/BodyWrapper/*"; a.InboundNodeEncoding = MessageBodyFormat.Xml; a.XmlStoredProcedureRootNodeName = "BodyWrapper"; a.ServiceBehaviors = new[] { new SqlAdapterInboundTransactionBehavior { TransactionIsolationLevel = IsolationLevel.Serializable } }; }); var xml = ((IAdapterBindingSerializerFactory)isa).GetAdapterBindingSerializer().Serialize(); Assert.That( xml, Is.EqualTo( "<CustomProps>" + "<BindingType vt=\"8\">sqlBinding</BindingType>" + "<BindingConfiguration vt=\"8\">" + "<binding name=\"sqlBinding\" " + "polledDataAvailableStatement=\"SELECT COUNT(1) FROM vw_claim_AvailableTokens\" " + "pollingStatement=\"EXEC usp_claim_CheckOut\" " + "pollingIntervalInSeconds=\"7200\" " + "inboundOperationType=\"XmlPolling\" " + "xmlStoredProcedureRootNodeName=\"BodyWrapper\" />" + "</BindingConfiguration>" + "<ServiceBehaviorConfiguration vt=\"8\">" + "<behavior name=\"ServiceBehavior\">" + "<sqlAdapterInboundTransactionBehavior transactionIsolationLevel=\"Serializable\" />" + "</behavior>" + "</ServiceBehaviorConfiguration>" + "<EndpointBehaviorConfiguration vt=\"8\"><behavior name=\"EndpointBehavior\" />" + "</EndpointBehaviorConfiguration>" + "<InboundBodyLocation vt=\"8\">UseBodyPath</InboundBodyLocation>" + "<InboundBodyPathExpression vt=\"8\">/BodyWrapper/*</InboundBodyPathExpression>" + "<InboundNodeEncoding vt=\"8\">Xml</InboundNodeEncoding>" + "<OutboundBodyLocation vt=\"8\">UseBodyElement</OutboundBodyLocation>" + "<OutboundXmlTemplate vt=\"8\"><bts-msg-body xmlns=\"http://www.microsoft.com/schemas/bts2007\" encoding=\"xml\"/></OutboundXmlTemplate>" + "<DisableLocationOnFailure vt=\"11\">0</DisableLocationOnFailure>" + "<SuspendMessageOnFailure vt=\"11\">-1</SuspendMessageOnFailure>" + "<IncludeExceptionDetailInFaults vt=\"11\">-1</IncludeExceptionDetailInFaults>" + "<CredentialType vt=\"8\">None</CredentialType>" + "<OrderedProcessing vt=\"11\">0</OrderedProcessing>" + "</CustomProps>")); }
public void ValidateDoesNotThrow() { var isa = new WcfSqlAdapter.Inbound( a => { a.Address = new SqlAdapterConnectionUri { InboundId = "AvailableBatches", Server = "localhost", InitialCatalog = "BizTalkFactoryTransientStateDb" }; a.InboundOperationType = InboundOperation.XmlPolling; a.PolledDataAvailableStatement = "SELECT COUNT(1) FROM vw_claim_AvailableTokens"; a.PollingStatement = "EXEC usp_claim_CheckOut"; a.PollingInterval = TimeSpan.FromHours(2); a.InboundBodyLocation = InboundMessageBodySelection.UseBodyPath; a.InboundBodyPathExpression = "/BodyWrapper/*"; a.InboundNodeEncoding = MessageBodyFormat.Xml; a.XmlStoredProcedureRootNodeName = "BodyWrapper"; a.ServiceBehaviors = new[] { new SqlAdapterInboundTransactionBehavior { TransactionIsolationLevel = IsolationLevel.Serializable } }; }); Assert.That(() => ((ISupportValidation)isa).Validate(), Throws.Nothing); }