Configure a WCF-NetTcp Send Port

You can configure a WCF-NetTcp send port either programmatically or by using the BizTalk Administration console.

Configuration properties

The BizTalk Explorer Object Model exposes an adapter-specific interface for send ports named ITransportInfo that has the TransportTypeData read/write property. This property accepts a WCF-NetTcp send port configuration property bag in the form of a name-value pair of XML strings.

The TransportTypeData property of the ITransportInfo interface is not required. If it is not set, the adapter uses the default values for the WCF-NetTcp send port configuration, as indicated in the following table.

The following table lists the configuration properties you can set in the BizTalk Explorer Object Model for WCF-NetTcp send ports.

Property name Type Description
Identity XML Blob, for example:

<identity>
<userPrincipalName value="username@contoso.com"/>
</identity>
Specify the identity of the service that this send port expects. These settings enable this send port to authenticate the service. In the handshake process between the client and service, the Windows Communication Foundation (WCF) infrastructure will ensure that the identity of the expected service matches the values of this element.

The default is an empty string.
StaticAction String Specify the SOAPAction header field for outgoing messages. This property can also be set through the message context property WCF.Action in a pipeline or orchestration.

You can specify this value in two different ways: the single action format and the action mapping format. If you set this property in the single action format, for example, http://contoso.com/Svc/Op1, the SOAPAction header for outgoing messages is always set to the value specified in this property.

If you set this property in the action mapping format, the outgoing SOAPAction header is determined by the BTS.Operation context property. For example, if this property is set to the following XML format and the BTS.Operation property is set to Op1, the WCF send adapter uses http://contoso.com/Svc/Op1 for the outgoing SOAPAction header.

<BtsActionMapping>
<Operation Name="Op1" Action="http://contoso.com/Svc/Op1" />
<Operation Name="Op2" Action="http://contoso.com/Svc/Op2" />
</BtsActionMapping>

If outgoing messages come from an orchestration port, orchestration instances dynamically set the BTS.Operation property with the operation name of the port. If outgoing messages are routed with content-based routing, you can set the BTS.Operation property in pipeline components.

The default is an empty string.
OpenTimeout System.TimeSpan Specify a time span value that indicates the interval of time provided for a channel open operation to complete.

Default value: 00:01:00
SendTimeout System.TimeSpan Specify a time span value that indicates the interval of time provided for a send operation to complete. If you use a solicit-response send port, this value specifies a time span for the whole interaction to complete, even if the service returns a large message.

Default value: 00:01:00
CloseTimeout System.TimeSpan Specify a time span value that indicates the interval of time provided for a channel close operation to complete.

Default value: 00:01:00
MaxReceivedMessageSize Integer Specify the maximum size, in bytes, for a message (including headers) that can be received on the wire. The size of the messages is bounded by the amount of memory allocated for each message. You can use this property to limit exposure to denial of service (DoS) attacks.

The WCF-NetTcp adapter leverages the NetTcpBinding class in the buffered transfer mode to communicate with an endpoint. For the buffered transport mode, the NetTcpBinding.MaxBufferSize property is always equal to the value of this property.

Default value: 65536
EnableTransaction Boolean Specify whether a message is transmitted to the destination service and deleted from the MessageBox database in a transactional context using the transaction protocol specified in the TransactionProtocol property.

Default value: False
TransactionProtocol Enum

- OleTransaction
- WS-AtomicTransaction
Specify the transaction protocol to be used with this binding.

Default value: OleTransaction
SecurityMode Enum

- None
- Message
- Transport
- TransportWithMessageCredential

For more information about the member names for the SecurityMode property, see the Security mode property in the WCF-NetTcp Transport Properties Dialog Box, Send, Security tab in the UI guidance and developers API namespace reference.
Specify the type of security that is used.

Default value: Transport
TransportClientCredentialType Enum

- None
- Windows
- Certificate

For more information about the member names for the TransportClientCredentialType property, see the Transport client credential type property in the WCF-NetTcp Transport Properties Dialog Box, Send, Security tab in the UI guidance and developers API namespace reference.
Specify the type of credential to be used when performing the send port authentication.

Default value: Windows
TransportProtectionLevel Enum

- None - No protection.
- Sign - Messages are signed.
- EncryptAndSign - Messages are encrypted and signed.
Specify security at the level of the TCP transport. Signing messages mitigates the risk of a third party tampering with the message while it is being transferred. Encryption provides data-level privacy during transport.

Default value: EncryptAndSign
MessageClientCredentialType Enum

- None
- Windows
- UserName
- Certificate

For more information about the member names for the MessageClientCredentialType property, see the Message client credential type property in the WCF-NetTcp Transport Properties Dialog Box, Send, Security tab in the UI guidance and developers API namespace reference.
Specify the type of credential to be used when performing client authentication using message-based security.

Default value: Windows
AlgorithmSuite Enum

For more information about the member names for the AlgorithmSuite property, see the Algorithm suite property in the WCF-NetTcp Transport Properties Dialog Box, Send, Security tab in the UI guidance and developers API namespace reference.
Specify the message encryption and key-wrap algorithms. These algorithms map to those specified in the Security Policy Language (WS-SecurityPolicy) specification.

Default value: Basic256
ClientCertificate String Specify the thumbprint of the X.509 certificate for authenticating this send port to services. This property is required if the ClientCredentialsType property is set to Certificate. The certificate to be used for this property must be installed into the My store in the Current User location.

The default is an empty string.
AffiliateApplicationName String Specify the affiliate application to use for Enterprise Single Sign-On (SSO).

The default is an empty string.
UseSSO Boolean Specify whether to use Single Sign-On to retrieve client credentials for authentication with the destination server.

Default value: False
UserName String Specify the user name to use for authentication with the destination server when the UseSSO property is set to False. You do not have to use the domain\user format for this property.

The default is an empty string.
Password String Specify the password to use for authentication with the destination server when the UseSSO property is set to False.

The default is an empty string.
OutboundBodyLocation Enum

- UseBodyElement - Use the BizTalk message body part to create the content of the SOAP Body element for an outgoing message.
- UseTemplate - Use the template supplied in the OutboundXMLTemplate property to create the content of the SOAP Body element for an outgoing message.

For more information about how to use the OutboundBodyLocation property, see Specifying the Message Body for the WCF Adapters.
Specify the data selection for the SOAP Body element of outgoing WCF messages.

Default value: UseBodyElement
OutboundXMLTemplate String

For more information about how to use the OutboundXMLTemplate property, see Specifying the Message Body for the WCF Adapters.
Specify the XML-formatted template for the content of the SOAP Body element of an outgoing message. This property is required if the OutboundBodyLocation property is set to UseTemplate.

The default is an empty string.
InboundBodyLocation Enum

- UseBodyElement - Use the content of the SOAP Body element of an incoming message to create the BizTalk message body part. If the Body element has more than one child element, only the first element becomes the BizTalk message body part. This property is valid only for solicit-response ports.
- UseEnvelope - Create the BizTalk message body part from the entire SOAP Envelope of an incoming message.
- UseBodyPath - Use the body path expression in the InboundBodyPathExpression property to create the BizTalk message body part. The body path expression is evaluated against the immediate child element of the SOAP Body element of an incoming message. This property is valid only for solicit-response ports.

For more information about how to use the InboundBodyLocation property, see Specifying the Message Body for the WCF Adapters.
Specify the data selection for the SOAP Body element of incoming WCF messages.

Default value: UseBodyElement
InboundBodyPathExpression String

For more information about how to use the InboundBodyPathExpression property, see WCF Adapters Property Schema and Properties.
Specify the body path expression to identify a specific part of an incoming message used to create the BizTalk message body part. This body path expression is evaluated against the immediate child element of the SOAP Body node of an incoming message. If this body path expression returns more than one node, only the first node is chosen for the BizTalk message body part. This property is required if the InboundBodyLocation property is set to UseBodyPath. This property is valid only for solicit-response ports.

The default is an empty string.
InboundNodeEncoding Enum

- XML
- Base64 - Base64 encoding.
- Hex - Hexadecimal encoding.
- String - Text encoding - UTF-8.
- XML - The WCF adapters create the BizTalk message body with the outer XML of the node selected by the body path expression in InboundBodyPathExpression.
Specify the type of encoding that the WCF-NetTcp send adapter uses to decode for the node identified by the XPath specified in InboundBodyPathExpression. This property is required if the InboundBodyLocation property is set to UseBodyPath. This property is valid only for solicit-response ports.

Default value: XML
PropagateFaultMessage Boolean

- True - Route the message that fails outbound processing to a subscribing application (such as another receive port or orchestration schedule).
- False - Suspend failed messages and generate a negative acknowledgment (NACK).
Specify whether to route or suspend messages failed in outbound processing.

This property is valid only for solicit-response ports.

Default value: True

How to Configure a WCF-NetTcp Send Port with the BizTalk Administration Console

You can set WCF-NetTcp send port adapter variables in the BizTalk Administration console. If properties are not set for the send port, the default values for the WCF-NetTcp send port configuration are used, as indicated in the previous table.

Configure variables for a WCF-NetTcp send port

  1. In the BizTalk Administration console, create a new send port or double-click an existing send port to modify it. For more information, see How to Create a Send Port. Configure all of the send port options and specify WCF-NetTcp for the Type option in the Transport section of the General tab.

  2. On the General tab, in the Transport section, click the Configure button next to Type.

  3. In the WCF-NetTcp Transport Properties dialog box, on the General tab, configure the endpoint address, the service identity, and the SOAPAction header for the WCF-NetTcp send port. For more information about the General tab in the WCF-NetTcp Transport Properties dialog box, see the WCF-NetTcp Transport Properties Dialog Box, Send, General tab in the UI guidance and developers API namespace reference.

  4. In the WCF-NetTcp Transport Properties dialog box, on the Binding tab, configure the time-out and transaction properties. For more information about the Binding tab in the WCF-NetTcp Transport Properties dialog box, see the WCF-NetTcp Transport Properties Dialog Box, Send, Binding tab in the UI guidance and developers API namespace reference.

  5. In the WCF-NetTcp Transport Properties dialog box, on the Security tab, define the security capabilities of the WCF-NetTcp send port. For more information about the Security tab in the WCF-NetTcp Transport Properties dialog box, see the WCF-NetTcp Transport Properties Dialog Box, Send, Security tab in the UI guidance and developers API namespace reference.

  6. In the WCF-NetTcp Transport Properties dialog box, on the Messages tab, specify the data selection for the SOAP Body element. For more information about the Messages tab in the WCF-NetTcp Transport Properties dialog box, see the WCF-NetTcp Transport Properties Dialog Box, Send, Messages tab in the UI guidance and developers API namespace reference.

Configure a WCF-NetTcp Send Port Programmatically

You can use the following format to set the properties:

<CustomProps>

  <UseSSO vt="11">0</UseSSO>
  <InboundBodyLocation vt="8">UseBodyElement</InboundBodyLocation>
  <InboundBodyPathExpression vt="8" />
  <MessageClientCredentialType vt="8">Windows</MessageClientCredentialType>
  <SendTimeout vt="8">00:01:00</SendTimeout>
  <OutboundXmlTemplate vt="8"><bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="xml"/></OutboundXmlTemplate>
  <OpenTimeout vt="8">00:01:00</OpenTimeout>
  <AlgorithmSuite vt="8">Basic256</AlgorithmSuite>
  <SecurityMode vt="8">Transport</SecurityMode>
  <TransportClientCredentialType vt="8">Windows</TransportClientCredentialType>
  <ClientCertificate vt="8" />
  <TransactionProtocol vt="8">OleTransactions</TransactionProtocol>
  <MaxReceivedMessageSize vt="3">2097152</MaxReceivedMessageSize>
  <StaticAction vt="8">http://www.northwindtraders.com/Service/Operation</StaticAction>
  <TransportProtectionLevel vt="8">EncryptAndSign</TransportProtectionLevel>
  <CloseTimeout vt="8">00:01:00</CloseTimeout>
  <EnableTransaction vt="11">0</EnableTransaction>
  <InboundNodeEncoding vt="8">Xml</InboundNodeEncoding>
  <PropagateFaultMessage vt="11">-1</PropagateFaultMessage>
  <OutboundBodyLocation vt="8">UseBodyElement</OutboundBodyLocation>
</CustomProps>

The following code fragment illustrates creating a WCF-NetTcp send port:

Caution

This example or guidance references sensitive information, such as a connection string or a username and password. Never hardcode these values in your code, and make sure that you protect confidential data by using the most secure authentication available. For more information, see the following documentation:

// Use BizTalk Explorer object model to create new WCF-NetTcp send port.
string server = System.Environment.MachineName;
string database = "BizTalkMgmtDb";
string connectionString = string.Format("Server={0};Database={1};Integrated Security=true", server, database);
string transportConfigData = @"<CustomProps>
                                 <StaticAction vt=""8"">http://www.northwindtraders.com/Service/Operation</StaticAction>
<OpenTimeout vt=""8"">00:01:00</OpenTimeout>
                               </CustomProps>";
//requires project reference to \Program Files\Microsoft BizTalk Server 2009\Developer Tools\Microsoft.BizTalk.ExplorerOM.dll
BtsCatalogExplorer explorer = new Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer();
explorer.ConnectionString = connectionString;
// Add a new BizTalk application
Application application = explorer.AddNewApplication();
application.Name = "SampleBizTalkApplication";
// Save
explorer.SaveChanges();

// Add a new static one-way send port
SendPort sendPort = application.AddNewSendPort(false, false);
sendPort.Name = "SampleSendPort";
sendPort.PrimaryTransport.TransportType = explorer.ProtocolTypes["WCF-NetTcp"];
sendPort.PrimaryTransport.Address = "net.tcp://mycomputer/private/samplequeue";
sendPort.PrimaryTransport.TransportTypeData = transportConfigData; // propertyData; // need to change
sendPort.SendPipeline = explorer.Pipelines["Microsoft.BizTalk.DefaultPipelines.PassThruTransmit"];
// Save
explorer.SaveChanges();

See Also

WCF Adapters Property Schema and Properties Specifying the Message Body for the WCF Adapters Installing Certificates for the WCF Adapters Configuring the WCF-NetTcp Adapter Configuring Dynamic Send Ports Using WCF Adapters Context Properties