Configure a WCF-NetNamedPipe Send Port

You can configure a WCF-NetNamedPipe 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-NetNamedPipe 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-NetNamedPipe 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-NetNamedPipe 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.

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 WS-AtomicTransaction protocol.

Default value: False
TransactionProtocol Enum

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

Default value: OleTransaction
SecurityMode Enum

- None- This disables security.
- Transport: - Security is provided using underlying transport based security. It is possible to control the protection level with this mode.
Specify the type of security that is used.

Default value: Transport
TransportProtectionLevel Enum

- None - No protection.
- Sign - Messages are signed.
- EncryptAndSign - Messages are encrypted and signed.
Specify protection level of the named pipe. 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
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-NetNamedPipe send adapter uses to decode for the node identified by the body path 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

Configure a WCF-NetNamedPipe Send Port with the BizTalk Administration Console

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

Configure variables for a WCF-NetNamedPipe 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-NetNamedPipe 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-NetNamedPipe Transport Properties dialog box, on the General tab, configure the endpoint address, the service identity, and the SOAPAction header for the WCF-NetNamedPipe send port. For more information about the General tab in the WCF-NetNamedPipe Transport Properties dialog box, see the WCF-NetNamedPipe Transport Properties Dialog Box, Send, General tab in the UI guidance and developers API namespace reference.

  4. In the WCF-NetNamedPipe 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-NetNamedPipe Transport Properties dialog box, see the WCF-NetNamedPipe Transport Properties Dialog Box, Send, Binding tab in the UI guidance and developers API namespace reference.

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

  6. In the WCF-NetNamedPipe 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-NetNamedPipe Transport Properties dialog box, see the WCF-NetNamedPipe Transport Properties Dialog Box, Send, Messages tab in the UI guidance and developers API namespace reference.

Configure a WCF-NetNamedPipe Send Port Programmatically

You can use the following format to set the properties:

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

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

// Use BizTalk Explorer object model to create new WCF-NetNamedPipe 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-NetNamedPipe"];  
sendPort.PrimaryTransport.Address = "net.pipe://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-NetNamedPipe Adapter
Configuring Dynamic Send Ports Using WCF Adapters Context Properties