This post is to demonstrate how we can use WCF-WebHttp receive adapter for HTTP GET/POST. This also include the re-direct of https to http.
Consider the below URL are used in an (legacy) application which send GET/Post request to any other Integration Systems. If we need to get this GET/POST request flowing into the BizTalk we needs to re-direct this request to BizTalk IIS service. This can be achieve by Proxy redirect, but in dev environment we do not have this facility. Also the below post describe how we can handle different pages coming into BizTalk which required different processing.
WCF Web Service:
1- Create WCF-WebHttp web service using BizTalk WCF-Service Publishing Wizard to receive request and send response.
2- Click Next to go to the next page. Select Adapter Name as “WCF-WebHttp”, tick “Create BizTalk receive locations in the following application”. Select the application from the drop down. Click Next
3- Click Next. We do not want to Add Service Bus endpoint, so keep this untick and click next.
4- Select “Create a Request-Response Receive Port”. Click Next.
5- Select “Allow anonymous access to WCF service”. Click Next.
6- Click “Create” to create the web service.
1- Open IIS – Create a new application pool with the Identity as BizTalk isolated host user.
2- Change the application pool for the new created web service.
BizTalk Admin Console:
1- Open BizTalk Admin Console. Navigate to the application –> Receive location. There shall be new receive location created.
2- Click on configuration. Under “HTTP Method and URL Mapping” you need to add POST and GET method and the URL.
3- The “Page” variable is set in the variable mapping. I promoted the in coming URL post/get request page. In my case the the page is “test1.cfm” and “test2.cfm”. I have done this because they can subscribe and filtered to the individual orchestrations for different processing.
URL Re-Write :
1- Go to IIS. Application Web service.
2- Open URL Rewrite. Create the rules as per below
Below is the web.config file extract for the rules.
. . . . .
. . . . .
We need to re-direct https to http – to achieve this the above rules need to be created (as described in URL Re-write).
1. Update the HOST file in C:\Windows\System32\drivers\etc\host
2. Although we are redirecting from HTTPS to HTTP for the Authenticate request, we still need to setup SSL as SSL kicks in before the url redirect.
a. Use the Visual Studio Command and run the following two commands
makecert.exe -n “CN=Datacom Root CA,O=Datacom,OU=R&D,L=Auckland,S=UT,C=US” -pe -ss Root -sr LocalMachine -sky exchange -m 96 -a sha1 -len 2048 -r
makecert.exe -n “CN=Test.co.nz” -pe -ss My -sr LocalMachine -sky exchange -m 96 -in “Datacom Root CA” -is Root -ir LocalMachine -a sha1 -eku 18.104.22.168.22.214.171.124.1
b. Configure website bindings to use generated certificate.
Note: If you have Microsoft forefront install – then you need to – Add an exception rule to Microsoft Forefront to ignore the HOST file, otherwise the changes we made to the HOST file will be ignored and the default HOST file is used.
Please let me know if some one is having different approach to this?