Gorgo.Live.ToString()

Mariusz, Gorzoch tech Blog

Archive for May 2011

BizTalk + Visual Studio 2010 – issues with deployment

leave a comment »

Today a quick note : if you ever encounter issues with deploying your solution to BizTalk like:

  • you can not deploy your solution because BizTalk/Visual studio complain about improper binding
  • you deploy your solution over existing one and setting of your send/receive port get lost or mess-up

then probably visual studio forgot to refresh copy of your binding BizTalk configuration.

In that case you need:

  • shutdown Visual Studio
  • go to “C:\Users\{UserName}\AppData\Roaming\Microsoft\BizTalk Server\Deployment\BindingFiles” and delete all files from there
  • open Visual Studio and try to deploy solution once again

now everything should start work again like a charm.

Advertisements

Written by Mariusz Gorzoch

30 May 2011 at 10:21

BizTalk 2010 and InfoPath integration

with one comment

Today I needed to build a solution where BizTalk will process some data and throw out a InfoPath form with details of processed message. I remember that in the past were I was doing that I used an orchestration and some construct/assign massage shape to achieve that, but today I decided to find if this is really the easiest possible way and guess what ! = this is the most complicated way.

In this post I decided to describe the simplest way I found and believe me it is worth reading if you used orchestration approach in the past. Lately I have an chance to work for a while with one smart person from Denmark, who shows me that BizTalk is done in the way that a lot of thinks can be done really easy (if you know what you are doing ;))

So, where we start:

1. Start by designing your InfoPath form.

Do this by simply grabbing your XML document (the one with is produced by BizTalk and you want to turn it on info InfoPath form). Simply start InfoPath and pick-up option to design your form from XML/XSD document. In my case I manage to design form like the one shown below (not really fancy one):

image

Once you finish, publish your template somewhere where everyone can access it.

2. Create instance of your document

Simply open your form and fill it with data. Once you do it, save this form to desktop and open it with “notepad”. The result in my case is shown below:

image

What we need from that file are the “Processing instructions” or information placed in the header witch are used by explorer (and all other kind of apps) to find out what program should be used to process that file. In my case this section looks like this:

<?mso-infoPathSolution
solutionVersion="1.0.0.2"
productVersion="14.0.0"
PIVersion="1.0.0.0"
href="http://whmpplgdn7121:81/BizTalkInfoPath/Forms/template.xsn"
name="urn:schemas-microsoft-com:office:infopath:BizTalkInfoPath:http—hempel-com-SDS-V100" ?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.3"?>

Most of that staff is constant, but some like ‘”href” are not. Href is pointing to the place were you published you InfoPath template and it tells to InfoPath where he should look for it, when he is rendering your documents for the users.

Mark this entire “processing instruction” section and copy it to your clipboard, we goanna need it in a second.

3. Create send port of file type and “XmlTransmit” pipeline

Go to BizTalk to your favorite app and create a send port of type “File” and Pipeline = “XmlTransmit”:

image

and here goes a trick. Click on the “..” on the right side of the “Send pipeline”. This should open an window for you as shown below:

image

Option with are important for us are :

  • ProcessingInstructionOptions = 0 (0-append processing instruction, 1-create new)
  • ProcessingInstructionScope = 0 (0 – document, 1 – Envelope)
  • XmlAsmProcessingInstruction = here is a place where you should past your processing instructions

Once done, hit “OK” button and try to send document fallowing schema of the document you used to build InfoPath form. This should create an new file for you on the output folder, which you can click and see content in the InfoPath:
image

and once I click on it, the magic happens:

image

nice and simple

Written by Mariusz Gorzoch

16 May 2011 at 20:13

Adding WCF-SQL adapter on BizTalk

leave a comment »

I keep forgetting about how to do it, so I just decided to place this instruction here and keep as a reference when I’ll need this in the future. So, how to add WCF-SQL adapter to BizTalk ?

  1. Go to BizTalk installation CD and find “BT Server” folder and install ASDK_x86
  2. Go to BizTalk installation CD and find “BT Server folder and install AdapterPack_x86
  3. Go to “BizTalk administration console"->”BizTalk group”->Platform settings”, right click on “Adapter and choice “New->Adapter”. From “Adapter” drop down list pick-up “WCF-SQL”, give it a name “WCF-SQL” and hit Ok
  4. Restart BizTalk host instance

Done. Now I have a reference in case I’ll need this in future 🙂

Written by Mariusz Gorzoch

13 May 2011 at 15:55

Posted in BizTalk 2010