apiadapterbiztalkwcf-web-apibiztalk-2013r2

Publish/expose RESTful API using WCF-WebHttp


I have a requirement to expose/publish a RESTful API service from BizTalk 2013 r2.

I have published a service in IIS and when I browse it is working, but I am unable to call the API from SOAP UI. I have tried using this link: Exploring REST Capabilities of BizTalk Server 2013 (Part 1: Exposing REST Endpoints)

My API URL has 3 mandatory parameters (first 3) and 2 optional ones(last 2). I have used btsvariable mapping.

Required Sample URL is

/rest/testlink/write/data/apiservice/V01/rs/call/search/{name}/{rows}/{starts}?year=<year>&AdditionalName=<additional>

Example:

https://localhost/rest/testlink/write/data/apiservice/V01/rs/call/search/brown/99/true?year=2007,2008,2009&AdditionalName=true

In the WCF web HTTP receive location BizTalk is using /serviceapi/Service1.svc But this service1.svc is nowhere in the sample URL expected for the client.

I have highlighted the variable above and there is also a query ? and =. So, how can I set this in WCF-WebHttp and expose the rest API?

How will the client calling this service know the parameters if BizTalk uses the below URL? This URL works when I browse, but I believe this is the WSDL link.

How to publish an API with query parameters?

https://localhost/serviceapi/Service1.svc

Solution

  • BizTalk receive location when exposed using the Web HTTP adapter are exposed as .svc. because it uses the WCF framework to enable the REST capabilities. The url is not a REST url in the true sense.

    What you need is the url masking to make it look like the rest url. It is a perfect use case for Azure API management as it masks the underlying url.

    The fact that it has servce1.svc should not matter as the client would still be able to execute GET requests on the end point you have exposed