Things hard and not so hard.... RSS 2.0

Folks - my blog has moved to

# Tuesday, 19 February 2013

“Ding ding” after spending 4 rounds(hours) in the ring with this guy, I’m taking the gloves off and heading for the showers and salts.

I’m in the middle of some BizTalk work (which is nice for a change) and I’m ticking my tasks off.

I’ve got a REST receive port exposed from BizTalk via IIS and published through the WCF Publishing Wizard.


(there’s Operations mappings and extracting variables from the URL to Context Properties under the Configure – omitted for brevity)

Couple of shots of the WCF Service Publishing Wizard:



The issue here is that – once the Wizard completes you’ll get:

http://<servername>/coreapi/customer/Service1.svc as the URL to call.

The task was simple:

I wanted to call URLs such as




And not their equivalents of:



The Solution was to use IIS URL Rewrite which looks to be the Swiss Army knife that MacGuyver uses.. (but he only needs a paperclip to take out an entire train).

Lots of samples and numerous examples of solutions that work and people are high-fiving in about 5 mins of starting…alas not for me Sad smile. The other point to note here also is that a URL Rewrite module exists for:

  • Default Web Site
  • Each IIS Application under the Root Website.

I wanted to keep things confined to just my IIS Application and not have to have requirements of changing the Default Web Site for instance.

The tricky part was to find out how IIS works and it’s matching.


Underneath CoreApi I have Customer as an Application as in


**The part that URL Rewrite appears to do** (that floored me for a while)

It chunks the FULL REQUEST and passes just the part required to your app.

So take the full URL:


As you traverse down the IIS ‘Application tree’ the URL that is passed to each URL Rewrite in each underlying IIS Application is *different*, as in:

  • /coreapi = ‘customer/1234234/enquire’
  • /coreapi/customer = ‘1234234/enquire’

This was possibly the hardest piece to figure out. I’d setup failed request tracing in IIS and those logs, while I feel like I’m walking into the Engineering room of the century with all the logs, pages and info… I wasn’t seeing ‘URL Rewrite failed to apply your rule because …..’  - it just wasn’t appearing plain and simple.

URL Rewrite – the rules that won the show

  1. Under /coreapi/customer in IIS Manager
  2. Started off with a Blank Rule and setup the following:
    1. image
    2. image

So the RegEx Rule (at this level) simply states – if the Request begins with a number, then prepend ‘Service1.svc/’ to it.

The key is knowing what the URL being passed to URL Rewrite is at this level in the IIS Application/vdir tree.

What the web.config says at this level:

               <rule name="CoreApi Rule" patternSyntax="ECMAScript">
                   <match url="([0-9].*)" />
                   <action type="Rewrite" url="Service1.svc/{R:1}" appendQueryString="false" logRewrittenUrl="true" />

I hope I’ve saved you a bit of time on your next endeavour.

Tuesday, 19 February 2013 16:12:33 (AUS Eastern Daylight Time, UTC+11:00)  #    Comments [0] -
BizTalk | BizTalk 2013 | Tips
<2013 February>
 AppFabric CAT
AppFabric Windows Server Customer Advisory Team - New Blog.
[Feed] BizTalk 2006 - Windows SharePoint Services adapter
BizTalk 2006 Sharepoint adapter!!
 Breeze SharePoint 2010 Bootcamp
Breeze SharePoint 2010 Bootcamp
[Feed] BTS 2006 R2/EDI
[Feed] Chris Vidotto (MS BTS Legend)
Needs no intro....
 Mark Daunt
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2017
Sign In
Total Posts: 608
This Year: 0
This Month: 0
This Week: 0
Comments: 270
All Content © 2017, Breeze