XRef XML Creation Tool

A few weeks ago, I spent quite a bit of time crafting the XML to load data into the databases. I have a tool that will do all of the heavy lifting. It is pretty self explanatory,you createa list ofapplication types, instances where youassociate it with the particularapplication type, create the IDXrefs and then create the elements. Here you choose theIDXref it’s associated Application Instance and the the CommonID and the AppID.Then tomake sure you don’t over write another set of documents, you give it a base name, choose the folder, and the folder you want to save it in, and it will generate all of the files for you, including the setup.xml file. If there are duplicates on either the CommonID or AppID it will add a period to the end of the data.

Here are some screen shots of what it does:

Which results in the following in the xml files in the directory specified

C:\sample\example.listOfAppType.xml

C:\sample\example.listOfAppInstance.xml

C:\sample\example.listOfAppIDXRef.xml

C:\sample\example.listOfIDXRefData.xml

And the best part:

C:\sample\example.setup.xml

If you would like this application, refer to the disclaimer on the right side of the screen, and then through my contacts page I will send you the application.

Consuming Web Services in BizTalk Without Web Reference

Twice last week, I received WSDLs to consume that BizTalk didn’t like. That is, when I would try and load the WSDL via Add Web Reference, I’d get an error like the following:
Could not generate BizTalk files. Unable to import WebService/Schema. Unable to import
binding ‘WebServiceBinding’ from namespace
‘http://xmlns.company.com/interface/project/SubmitSubjectImpl’. Unable to import operation
‘SubmitSubject’. The element ‘http://xmlns.company.com/project/subject:subjectrequest’ […]

BizTalk Server 2006 R2 – Beta 2 shipped!

BizTalk Server 2006 R2 – Beta 2 shipped!

Just in case you missed this from other sources BizTalk Server 2006 R2 – Beta 2 shipped last week.

Heres some verbiage that explains the whole deal:

BizTalk Server 2006 R2 will be 5th major release of BizTalk Server. This is another huge step forward for our 6,500+ customers globally and will add new capabilities for customers that need EDI and RFID. While there are numerous improvements to BizTalk, this release has three major themes:

EDI: The native support for comprehensive EDI and AS2 protocols in BizTalk Server 2006 R2 will provide much richer data integration and management capabilities for our customers. The Base EDI adapter that comes with BizTalk Server 2006 enables the sending and receiving of messages using X12 and EDIFACT. Customers can leverage this base functionality in order to build custom EDI solutions.

RFID: BizTalk RFID provides rich data, device and event management, as well as open APIs and tools. The capabilities allow customers to cost effectively build vertical solutions and configure intelligent RFID-driven processes.

Platform Alignment: BizTalk Server 2006 R2 features improved alignment with 2007 Microsoft Office system and Windows Vista, including key .NET Framework 3.0 technologies such as WF and WCF. This alignment will help customers access LOB data, as well as system-to-system or supply-chain processes from within their Office System applications (like SharePoint Server, InfoPath and Dynamics).

FAQ

Q: How do I download the beta?

A: BizTalk Server 2006 R2 Beta 2 is hosted on the Microsoft connect site. If you have not registered in the past, a simple username and password is all that is required. It is a quick process. As well, you will find other Microsoft public beta products on the site.

Q: How do I provide product feedback?

A: Feedback is used to improve the software or services that are being evaluated in a connection or program. In Microsoft Connect, feedback issues can include bugs and suggestions. A bug is something that does not work the way you think it is supposed to, and a suggestion is something that you think could be made better by doing it a different way. A Feedback option appears on the Connect menu.

Q: Is this a supported Microsoft beta?

A: BizTalk Server 2006 R2 Beta 2 is an unsupported beta, however there will be community-based support for the release.

Q: Are all of the associated components of BizTalk included in Beta 2.

A: Yes, the download includes BizTalk Server, the adapters and the accelerators.

Q: What is your pricing and SKU model for BizTalk Server 2006 R2?

A: We are gathering customer feedback to understand their requirements, and will make further announcements on this topic as we get closer to launch.

Q: What is the timeline for Beta 3?

A: Microsoft will incorporate the customer feedback from Beta 2 into the development cycle. Currently there is not a beta 3 scheduled for BizTalk Server 2006 R2.

Q: When will BizTalk Server 2006 R2 be generally available?

A: The release of BizTalk Server 2006 R2 will be available in the 3rd quarter of CY07.

Turning an Immutable Message in BizTalk into a Mutable message

One thing that you learn pretty fast in BizTalk is that messages in an orchestration are immutable/read only.


If you need to modify a message in a BizTalk orchestration, you are pretty well restricted to using a Construct shape with encapsulated Transform and/or Message Assignment shapes to create a modified version or a copy of the original message. Distinguished fields,xpath statements, BizTalk maps, custom .Net components, etc. can be used to modify the message.


Below is one simple technique that can be used to modify a message anywhere in an orchestration.
Helper class(s) are required, but in certain situations (explained below) this technique can be used to easily modify a message anywhere in an orchestration.


Below is an orchestration where this technique is used:



 


Very simply this orchestration subscribes to a PO xml message and then produces a
final Invoice XML message that is send out from the orchestration.


Below are the artifacts used in the solution:



The artifacts for the BizTalk project, BTS_Immutable_To_Mutable include:

1) ClassOrchestration.odx (Orchestration as above)
2) Invoice.xsd (schema for outgoing Invoice XML message)
3) PO.xsd (schema for incoming PO XML message).
4) InvoiceClassGen.bat and POClassGen.bat


Below is the InvoiceClassGen.bat file:



The above uses the .Net xsd.exe utility to generate an Invoice.cs class from the Invoice.xsd schema.
This Invoice.cs class is used in the Class_Immutable_To_Mutable project as below. 


The artifacts for the Class Library project, Class_Immutable_To_Mutable include:


1) Helper.cs (Helper Class to populate the some of the fields of the Invoice)
2) Invoice.cs (Invoice class for variable in the orchestration)
3) PO.cs (PO class for variable in the orchestration)


This orchestration will:


1) Accept a PO xml message


2) As below, in an expression shape, assign the BTS PO message to a BTS variable message of type PO.cs


// Set the BTS Variable PO to the incoming BTS Message PO
varPO = msgPO;


3) As below, in an expression shape, populate some of the Invoice fields from the PO fields:


// Populate some of the fields in the BTS Invoice Variable,
// from the BTS PO variable fields.
varInvoice.TotalAmt = varPO.Amt;
varInvoice.TotalCount = varPO.Qty;


4) As below, in an expression shape, call a helper class to populate and return the Invoice Items class:


varInvoice.Items = Class_Immutable_To_Mutable.Helper.mapPOItemsToInvoiceItems(varPO);


5) As below, in an expression shape, call a helper class to return and assign the description for the invoice Description field.


// Set the BTS Variable Description field
varInvoice.Description = Class_Immutable_To_Mutable.Helper.GetInvoiceDesc(varInvoice);


6) As below, in an expression shape, call a helper class to return and assign the version for the invoice Version field:


// Set the BTS Message Invoice Version field
varInvoice.Version = Class_Immutable_To_Mutable.Helper.GetInvoiceVersion();


7) Finally at the end, in a Construct/Message Assignment shape, construct the the outgoing BTS Invoice message:


// Create the BTS Invoice message from the Variable Invoice message
msgInvoice = varInvoice;


8) Send out the Final Invoice XML message
 
So after all of this, could a BizTalk map been used to create the Invoice message from the PO message. The answer is yes or no depending on the mapping logic that is needed.


This leads to when use this method:
Creation of a message requires multiple calls to Helper components/Business Rules to create the message.


Some of the upsides to using this approach are:
1) Using the above technique takes away the restriction of the immutable message and working with a mutable variable in the orchestration.
2) Intellisense is available on the variables inside of the orchestration.
3) The variable can be modified directly in an expression shape inside of the orchestration, without the use of distinguished fields or xpath statements. 


Some of the downsides to using this approach are:
1) The overhead of deserialization and serialization from Message to Variable and visa versa.
2) Creating and maintaining the Helper classes (in this case PO.cs and Invoice.cs)

You can download the above example HERE (Zip File).
Read the Readme before installing and running the example.


For a similar example, goto Here
and download the Using a Custom .NET Type for a Message in Orchestrations example.
 

Off Topic: MVP Renewal (On April Fools Day)

Here's a good question! If you receive your MVP renewal on April Fools Day should you be worried?

Seriously, I'd like to thank everyone on the Commerce Server team for a great first year as an MVP and renewing my status for another year. Being an MVP has opened many doors for me as a developer, manager and (sometimes rather pushy) Microsoft customer and the relationships I've been able to develop have added a great richness to my life.

I'd also like to thank my Codebetter.com friends Darrel Norton, Jeffrey Palermo, Peter Van Ooijen, Brendan Tompkins, Jay Kimble, Steve Hebert, Jeremy Miller, Raymond Lewallen, Eric Wise, Sam Gentile, David Hayden, John Papa, Scott Bellware, Karl Seguin, Greg Young, Rod Paddock and our newest member Jean-Paul Boodhoo. You are by far, some of the best architects, developers and managers that I've ever been privileged to know!

And a special thanks to Darrel, Jeffrey, Jeremy, Raymond, Sam, Scott, Karl and Jean-Paul for allowing me to hang with you during the MVP Summit. It was a blast!

PS: Ben Miller – It was great meeting you in person!

Share this post: Email it! | bookmark it! | digg it! | reddit!| kick it!