Sunday, August 14, 2011

How to Configure IIS for an HTTP Receive Location, Biztalk 2010, windows 2008 R2, windows 7

Some time ago I had to migrate a biztalk application from 2006 to 2010 that used the http receive adapter to receive post requests. In order to make it work in IIS7, I had to perform quite a lot of steps and this is what I want to share here as I didn't find any 100% solution on the net.
The official microsoft guide is a good start and worth to take a look at but there some pieces missing in it to make this work. (http://msdn.microsoft.com/en-us/library/aa559072(v=bts.70).aspx)

Well lets start with the configuration. First, make sure that you got IIS installed with CGI and ISAPI coding functions. Go to program and functions in windows 7 or add feature if you're on windows 2008.

Then you have to perform these steps:

(before you proceed open IIS manager)

1 - AddISAPIHandler



First make sure that the ISAPI-dll handler is enabled

Top level Server settings -> Features view -> handler mappings
If ISAPI-dll handler is disabled right click it and select "edit feature permission"
check "Execute" box as on picture above.

2 - AddCGIHandler

Repeat the steps above for the CGI handler

3 - EditFeaturesSettings_addBtRestriction



Next add BTSHTTPReceive.dll to the ISAPI & CGI restrictions rules

Top level Server settings -> Features view -> ISAPI & CGI restrictions

Add

Browse to BTSHTTPReceive.dll

4 - EditFeatureSettings_permissions




Click on Edit Feature Settings and check the two boxes.

5 - Addmodulemapping




Go back to handler mappings (Top level Server settings -> Features view -> handler mappings)

Click on Module mapping and add a new module according to screen shots

6 - AddappPool



Now we need an application pool that runs under an account with access to BTSHTTPReceive.dll path.

7 - Finally, create an application with the application pool just created and under an account that has access to BTSHTTPReceive.dll.
(You can use the test functionality in IIS manager)



Test

Now you should be able to test the configuration.

Create a simple html form page that call the application you just created.

For instance:

"<html>
<body>
<h2>simple test form</h2>
<form method="post" action="http://localhost/MyTestHTTPapp/BTSHTTPReceive.dll?">
<fieldset>
<legend>testData</legend>
<label>someValue1</label><input type = "text" id = "value1" name="value1" value="some value 1" /><br/>
<label>someValue2</label><input type = "text" id = "value2" name="value2" value="some value 2" /><br/>
</fieldset>
<input class = "next" type = "submit" name="next" value = "send" />
</form>
</body>
</html>"

httpReceive



Create a http receive location according to screenshot above

Create for instance a file send location that subscribes to the BTS.receiveportname (for instance)

Start everything and post your form.
You should then "see" the post request in the file saved by your file send adapter:
In this sample request it should be;

"value1=some+value+1&value2=some+value+2&next=send"

And thats it, now your http post location should be operational!

3 comments:

  1. This is wonderful. I have a question for step 6 (Application Pool): what is the account under which the Application pool must be set? Nobody seems to explain properly. Should it be the BizTalk Service Account (the one that BizTalk Host runs under)?! Or any other BizTalk account with enough rights? Does it matter?
    Thank you!

    ReplyDelete
  2. Hi! Sorry for late response. The account running the app pool must be granted access to the folder where your 'BTSHTTPReceive.dll' resides (typically: C:\Program Files\Microsoft BizTalk Server 2006\HttpReceive) It should be enough with read / execute permissions.

    *And* it must also have access to Biztalk mgmt dB othervise you'll get this message: "The Messaging Engine failed to register the adapter for "HTTP" for the receive location "/PARTNERPLAYER/BTSHTTPReceive.dll". Please verify that the receive location exists, and that the isolated adapter runs under an account that has access to the BizTalk databases."

    I don't really understand why the app pool account needs this access ... but this is what happens if you put an account that just got access to the folder.

    ReplyDelete