Search code examples
c#webreporting-servicesasp.net-web-apissrs-2008

Consume web api in SSRS with parameter


I am trying to consume webapi in ssrs ( XML source ).

If will use parameter in the url (for testing purpose ) then its working really fine for example - http://some_xyz_url.com/Api/Report/GetReport?id=7 . so I can consume web api in SSRS

Real problem - I do not know how I can pass parameter to webapi from SSRS. I tried hard but no luck. Also I have searched stackoverflow there is no question near to my requirement.

I am using VS2012, (.net framework 4.0), SQL server 2008 (using Microsoft SQL server report builder)

Any help really appreciated.

I have upload the error message when I will try to pass the parameter from SSRS to webapi.

enter image description here

Updates

I have tried to pass parameter but for some reason the value of parameter is always null, Even after setting the default value. ( see below the attached jpg)

enter image description here

and here is how I am passing the parameter

enter image description here

but still getting 404 ( but I will use hard coded Id , its working fine in browser)

Please advise.


Solution

  • After a long try I was no able to solve this , here is what i follow at the end and it works I can not change web api , so I added a wcf service in the solution which was consuming webapi ( just a wrapper ). i know the wcf wrapper is not wise , but it solve the purpose to pass parameters to the webapi.

    and then I consume wcf service in my SSRS application.