Invoking TCP-Hosted WCF Services using BizTalk Server R2

//

One of the great features that we (TwoConnect) accomplished with the WSE 3.0 adapter for BizTalk Server was the support for non-HTTP transports. The capability of decoupling the Web Services interaction of the transport used for the communication opens a new set of possibilities for BizTalk Server processes.

This transport independence concept comes naturally in WSE 3.0 and is being taken to another level in the Windows Communication Foundation (WCF) channel model. As part of BizTalk Server R2 Microsoft provides a set of WCF adapters that uses a common set of WCF bindings. Among them the WCF-NetTcp adapter abstracts the interactions with WCF services that communicate using TCP as transport protocol. Alternatively we can use the WCF-Custom adapter which also understands the WCF NetTcp Binding

Let’s take the following WCF service as an example:

  

[ServiceContract()]

public interface IMathService

{

  [OperationContract]

  int Add(int param1, int param2);

}

  

public class MathService: IMathService

{

public int Add(int param1, int param2)

{

  return param1 + param2;

}

}

  

This WCF Service is associated with the following binding that declares the use of Tcp as the transport protocol of the WCF Service endpoint. The alternative endpoint is just used in order to have access to the Service description (WSDL).

  

                                     

<configuration>

      <system.serviceModel>

            <services>

                  <service name="MathService.MathService"

                               behaviorConfiguration="CalculatorServiceBehavior">

                        <host>

                              <baseAddresses>

                                    <add baseAddress="http://localhost:8000/servicemodelsamples/service"/>

                              </baseAddresses>

                        </host>

                        <!– this endpoint is exposed at: net.tcp://localhost:9000/servicemodelsamples/service  –>

                        <endpoint address="net.tcp://localhost:9000/servicemodelsamples/service"

                                      binding="netTcpBinding"

                                      bindingConfiguration="Binding1"

                                      contract="MathService.IMathService" />

                        <!– the mex endpoint is explosed at http://localhost:8000/ServiceModelSamples/service/mex –>

                        <endpoint address="mex"

                                      binding="mexHttpBinding"

                                      contract="IMetadataExchange" />

                  </service>

            </services>

            <bindings>

                  <netTcpBinding>

                        <binding name="Binding1"

                                     closeTimeout="00:01:00"

                                     openTimeout="00:01:00"

                                     receiveTimeout="00:10:00"

                                     sendTimeout="00:01:00"

                                     transactionFlow="false"

                                     transferMode="Buffered"

                                     transactionProtocol="OleTransactions"

                                     hostNameComparisonMode="StrongWildcard"

                                     listenBacklog="10"

                                     maxBufferPoolSize="524288"

                                     maxBufferSize="65536"

                                     maxConnections="10"

                                     maxReceivedMessageSize="65536">

                              <readerQuotas maxDepth="32"

                                                  maxStringContentLength="8192"

                                                  maxArrayLength="16384"

                                                  maxBytesPerRead="4096"

                                                  maxNameTableCharCount="16384" />

                             

                              <security mode="None">

                              </security>

                        </binding>

                  </netTcpBinding>

            </bindings>

       <behaviors>

                  <serviceBehaviors>

                        <behavior name="CalculatorServiceBehavior">

                              <serviceMetadata httpGetEnabled="true" />

                              <serviceDebug includeExceptionDetailInFaults="False                                " />

                        </behavior>

                  </serviceBehaviors>

            </behaviors>

      </system.serviceModel>

 

</configuration>

  

On the BizTalk Server side we need to generate the types corresponding to the WCF service. We do that using the WCF Adapter Metadata Wizard. Notice that the generated metadata is not related with a particular endpoint.

Finally in order to interact with the WCF service select the WCF-NetTcp adapter from the adapter list in the Send Port and configure the properties as illustrated in the following figure.

 

  

  

Notice the SOAP action header needs to be configured in order to identify the operation to invoke on the service side.

New! Line of Business Adapter Sample Walkthroughs and Whitepapers

New! Line of Business Adapter Sample Walkthroughs and Whitepapers


We have created three new sample walkthroughs for the PeopleSoft, Oracle, and JD Edwards OneWorld Line of Business adapters. Each adapter has two hands-on walkthroughs. In the first lab, you use the LOB system without any Microsoft technologies. In the second lab, you create a BizTalk orchestration and use the LOB adapter to connect to the LOB system. Go to http://msdn2.microsoft.com/en-us/biztalk/aa937652.aspx and find this content (or click on these links directly below).


 


 In addition, we have three brand new whitepapers we have just written by Brian Jones, Jay Lee, and Mark Michaelis entitled:


%u00b7         Microsoft BizTalk Adapters for JD Edwards EnterpriseOne and OneWorld


%u00b7         Microsoft BizTalk Adapters for PeopleSoft


%u00b7         Microsoft BizTalk Adapters for Siebel


 


Click on the links below to access the sample walkthroughs and whitepapers.


Line of Business Adapter Sample Walkthroughs



  • Using an Oracle System

  • Executing an Oracle Sample Query

  • Using a PeopleSoft System

  • Executing a PeopleSoft Enterprise Sample Get

  • Using a JD Edwards OneWorld System

  • Executing a JD Edwards OneWorld Sample Query

Line of Business Adapter Whitepapers



  • Microsoft BizTalk Adapters for JD Edwards EnterpriseOne and OneWorld

  • Microsoft BizTalk Adapters for PeopleSoft

  • Microsoft BizTalk Adapters for Siebel

      I am very interested in your feedback on these labs to assist me going forward with the other samples. Please send it to me via this blog site. Thank you for taking an interest in Micorosft products!

SWF2XAML (Flash to XAML) – Mike’s at it again!

Michael Swanson earlier in the year wrote a plugin for Adobe Illustrator that exports Al vector art to XAML. I used this to create a XAML map of New Zealand for my Tech.Ed presentation.


Michael has been tinkering again (outside of worktime) and come up with SWF2XAML: A Tool to Convert Flash Files to XAML. This is a V1 utility and there is more to do to support animation and action script conversion but it is a great start.


I have been keeping an eye on a couple of Flash developers in the US (1,2) that are testing the WPF waters, hopefully Mike’s new utilities + some of the  samples that have been released recently (1,2,3,4) will help people transition to this brave new world of build native next generation application for Windows.