Our first Applied Windows Workflow Foundation training is coming to London!

OK, Reading actually, but if you are in the London area and interested in workflow, then this is your chance to get a thorough understanding of not only the how of WF, but the why. We will look deep under the covers of building WF programs, hosts and activities/components. Check out the course information for more details and to register.
July 30 – August 2
Microsoft Technology Center in Reading
Course details: http://www.pluralsight.com/courses/appliedwf.aspx

BizTalk 2006 R2 – consume an .ASMX webservice using WCF-BasicHttp adapter

Normally when we need to consume a .asmx web service in BizTalk 2004/2006 (NOT R2) inside an orchestration, we add a web reference, which will create all the multi-part message and web port type required to consume the orchestration. You construct the orchestration and configure the SOAP adapter in the send port to consume the web service. I suppose that’s the normal route any BizTalk developer will take when you are put under a circumstance to consume an .asmx webservice using WCF-BasicHttp adapter.

But when you are going to use the WCF-BasicHttp adapter, “Add Web Reference” is not going to work, and we need to take advantage of the hidden “Consume WCF Service” wizard, which comes as part of BizTalk 2006 R2. The wizard will generate required schemas, multi-part messages, orchestration port types, and also binding files for both basicHttp and custom binding. I’ll put the steps here to consume a basic .asmx webservice in BizTalk 2006 R2 with WCF-BasicHttp adapter.

The sample webservice we are going to use contains a very simple webmethod as shown below.

[WebMethod]
public string ConcatName(string firstName, string lastName)
{
return firstName + ” ” + lastName;
}

The below walk-through is based on the sample webservice, which comes as part of the download.

  1. Create a blank BizTalk Project
  2. Right-Click on the project and select Add->Add Generated Items->Consume WCF Service
  3. Select the option “Metadata file (WSDL and XSD)“, Click “Next”
  4. Open an instance of a browser and navigate to your “.asmx?WSDL” file and save it somewhere in your harddrive (Example: c:\Service.wsdl).
  5. Click on the “Add” button (next step in the wizard after the one shown above), browse to the .WSDL file you saved in Step 4, Click “Next” (Accept defaults), Click “Import” and then Click “Finish” to complete the wizard.
  6. Once you click “Finish” the following files will be added to your project (File name will depend on the name of the .WSDL file you selected)
    Service.BindingInfo.xml
    Service.odx
    Service_Custom.BindingInfo.xml
    Service.tempuri_org.xsd
  7. Open the Service.odx file, inside the orchestration view create 2 messages as shown below
    WSRequest – Multi-part Message Type – ConsumeWebService.ConcatNameSoapIn
    WSResponse – Multi-part Message Type – ConsumeWebService.ConcatNameSoapOut
  8. Right-Click on the orchestration “Port Surface“, Click “Next”, In the port properties page Click “Next”, In the “Select a Port Type” page select “Use an existing Port Type” and select “ConsumeWebService.ServiceSoap“, In port binding page select “I’ll be sending a request and receiving a response.” for port direction and “Specify later” for port binding. Click “Next” and then “Finish”.
  9. Construct an orchestration as shown in the below figure
    Receive_1 -> Activate=true, Message= WSRequest
    Send_1 -> Message = WSRequest
    Receive_2 -> Message = WSResponse
    Send_2 -> Message = WSResponse
  10. I created a FILE Receive and FILE Send (Specify Now) port binding for port_2 and port_3
  11. Assign a key file to the project and set the “Application Name” to “ConsumeWebService“. Build and Deploy the project.
    Open BizTalk Administration Console, Right-Click on the application and select “Import Binding“. Browse to the auto generated binding file “Service.BindingInfo.xml” and select it.
  12. Bind your Orchestration to the correct ports and host. For the .asmx webservice logical port, select the auto generated “WcfSendPort_Service_ServiceSoap“. (Start the application)
  13. Create a sample message by right-clicking on “Service_tempuri_org.xsd” file and clicking “Generate Instance“. Drop the message in the folder you configured for port_2 in the orchestration, you should see the output result in folder you configured for port_3 in your orchestration.

Download the sample here

Nandri!

Saravana

Upcoming WCF/WF training

Several people have asked if I’m going to be at Teched next week, and unfortunately I won’t due to the limits on my travel schedule right now (thanks to our new little girl, Emma). However, several of my Pluralsight colleagues will be there speaking including Jon Flanders, Matt Milner, Brian Randell, and Ted Neward. Be sure to check out their talks.
As for my schedule, I’ll be teaching our next Double Feature: WCF + WF event later this month, the week of 6/25 in Los Angeles. Matt Milner will co-present with me.
We’ve had a great response to our Double Feature offerings because they’re a great way to pack a lot of information into a single week. You can kill two birds (WCF & WF) with one stone, as the saying goes. We still have a few seats left for the upcoming West coast offering. There is another planned for the East coast (Boston), later in Sept (the week of 9/24). You can check out our full course schedule here, and if you want to be notified when new courses are added to the schedule, subscribe to our course schedule blog.

Workflow Foundation Tracking Birds of a Feather (BOF) at Tech Ed 2007

I’m excited to be hosting a BOF this year at Tech Ed on the tracking services in Windows Workflow Foundation. If you are interested in talking about tracking in general, the use of the included SQL tracking and query APIs, or custom tracking services to solve real business problems, then be sure to attend. I think it will be a lot of fun to see how people use this technology as it is the key piece to real visibility in your workflows. Hope to see you there.
Session details (check schedules at Tech Ed to verify time and room):
BOF24: Windows Workflow Tracking in Action
Thursday, June 7, 2007 at 4:30 PM
Room S331

BizTalk Server 2006 Posters

My team has been working on a set of technical BizTalk Server 2006 posters that are finally ready and available for download. Hey, we had to have been doing something while we weren’t blogging. :^)


Be that as it may, the first in the series is a capabilities categorization poster that you can get here.


The next one is a runtime architecture poster downloadable here.


The final poster is a legacy modernization with BizTalk Server 2006 and Host Integration Server 2006 that you can get here.


In order to successfully download the posters make sure to follow the instructions near the bottom of the download page.


Let us know what you think about this set and if you have a good idea for the next wave of BizTalk Server 2006 R2 posters that we’ll be delivering once it launches please share it with us.


Oh, by the way, for those of you attending Tech Ed in Orlando next week; stop by the BizTalk Server booth. We’ll be giving away full sized prints of all three posters.


Enjoy!


mike woods

Orchestration performance

Orchestration performance

So I had to fire up my XP laptop today because my new Rode
Podcaster microphone (which is otherwise is totally awesome) won’t start on Vista
despite getting a usbaudio.sys hotfix from MS Support (which was a suprisingly painless
experience). 

Anyway – cleaning out my old harddrive I found this picture:

 

This is a picture of the BAM portal.  What I was doing was using BAM to give
me some rough performance metrics between two version of an orchestration.  In
the “XmlDocument” version of the orchestration I was reading in a 9MB Xml file into
BizTalk.  In the orchestration I was passing the document to a .NET component
as “XmlDocument” and reading the whole document.  This is the typical example
code you’ll find for reading BizTalk messages from .NET code.

In the “XmlReader” version of the orchestration – I was passing the message as XLANGMessage. 
This is the underlying datatype that the Orchestration compiler uses to represent
a message.  Only when you pass it to a .NET component as XmlDocument do they
actually convert it to an XmlDocument (even if your message type on your orchestration
is System.Xml.XmlDocument btw).  Inside of the method my code looked something
like this:

public static XmlDocument
FromMsg(XLANGMessage old)
{
    //get
at the data


    XmlDocument ret = new XmlDocument();
    XmlReader reader = (XmlReader)old[0].RetrieveAs(typeof(XmlReader));
    //construct
new message from old


    //read
property


    object msgid = old.GetPropertyValue(typeof(BTS.MessageID));
    return ret;
}

By calling RetrieveAs and passing typeof(XmlReader) I avoid loading the BizTalk message
into a DOM – and can read the message using standard XmlReader techniques. 

As you can see from the BAM metrics (which is not an absolutely high performance timing
mechanism – but in this case should be close enough) the XmlDocument version took
about 3xs as long as the XmlReader version.  So rule of thumb – if you care about
performance – use XmlReader with XLANGMessage – not XmlDocument for your .NET methods
from an Orchestration.

Unfortunately the XLANGs compiler won’t allow us to return XmlReader as the return
value – so for constructing we are still stuck with the DOM.

AS/2 Certificate Management

We have received a lot of questions from our TAP customers and beta users regarding how and where to configure certificates for encryption and signing of AS/2 messages and MDNs in BizTalk Server 2006 R2. To that end, our resident expert Yury Bogucharov posted some help on the MSDN forum (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1633486&SiteID=1) for R2 EDI. I thought that it would also make a good blog post so I reformatted Yury’s message into table format and am posting it here for the benefit of all. Thanks Yury!


 



























































Message or MDN


Direction


Certificate Type


Certificate Owner


Public or Private


Certificate Location


Where to configure


Message


Outbound


Signing


Home Org


Private


Personal certificate store of in-proc host user


BizTalk Group / Properties / Certificate


Message


Outbound


Encryption


Partner


Public


Other People certificate store of local computer


Send port / Certificate


Message


Inbound


Signing


Partner


Public


Other People certificate store of local computer


Party / Certificate


Message


Inbound


Encryption


Home Org


Private


Personal certificate store of in-proc host user


Isolated Host / Certificates


MDN


Outbound


Signing


Home Org


Private


Synch MDN: Personal certificate store of isolated host user


Asynch MDN: Personal certificate store of in-proc host user


BizTalk Group / Properties / Certificate


MDN


Inbound


Signing


Partner


Public


Other People certificate store of local computer


Party / Certificate


Cheers,


Tony

Tech-Ed Session on BizTalk 2006 R2 Advanced Concepts

Just wanted put in a plug for me firstbreak out session called Advanced Microsoft BizTalk 2006 R2 Concepts. It’s SOA312 and it is on Thursday at 2:45 PM.

The abstract is:

“Business processes are a required component in most Enterprise Integration solutions today. Business processes are modeled, designed, and built inside BizTalk Server 2006 R2 using Orchestrations. Orchestration can range from a few simple shapes to a complex multi Orchestration, Transactional process. This session focuses on highlighting key Orchestration features to shorten development time and increase overall Business Process reusability. Also, messaging-only scenarios using WCF are discussed, and the power of BizTalk as a Web service routing system is shown. Topics covers are: Untyped Messages, Dynamic Transforms, Starting Orchestration and Passing Port Parameters, using Helper .NET Components, and Message Only WCF Calls.

If you like the content on me website and blog, then you will probably like this talk.

Hope to see you in Orlando!