bsaglamtimur
bsaglamtimur

Reputation: 395

Rest WCF service as DataSource for SSRS

I have a central WCF Rest service as data source for my various apps. Now it's time to tie SSRS to this service, but I could not figure it out. Some methods called with querystring parameters like UriTemplate = "UretilenUrunler?urunId={urunId}&num2={theNum}"

 - http://myserver/WcfRestServices/service/Uretilenurunler?urunId=5aa&num=49

And most of methods called like UriTemplate = "urundetay/{urunid}/sortorder"

 - http://myserver/WcfRestServices/service/urundetay/5aa/az

How can I access to my WCF service and define parameters within SSRS?

Thanks in advanced.

Upvotes: 0

Views: 2673

Answers (1)

djangojazz
djangojazz

Reputation: 13242

Three things about WCF and talking to SSRS:

  1. You need your service to be bound with HTTP (looks like you do, I don't think it works with NET.TCP directly)

  2. Your connection source must be 'XML' and use the connection string of the WCF service with it's service extension. EG:

    http://localhost/Reporting/ReportingService.svc
    
  3. SSRS has it's own xml query method of SOAP requests that I am not familiar enough with SOAP to know if this is proprietary to MS and SSRS technologies or not. Now with my service I kept the DEFAULT NAMESPACE WCF assigns it of 'tempuri.org'. If you put in your OWN namespace you need to declare it instead. For the SOAP action you need your namespace, interface, and then implementation method.

It works like this:

<Query>
  <Method Name="GetMonthlyData2" Namespace="http://tempuri.org/">
    <Parameters>
      <Parameter Name="aStart" Type="Date"></Parameter>
      <Parameter Name="aEnd" Type="Date"></Parameter>
    </Parameters>
  </Method>
  <SoapAction>
    http://tempuri.org/IReportingService/GetMonthlyData2
  </SoapAction>
</Query>

IMHO WCF with SSRS does not work well for a number of reasons:

  1. It does not transfer types well at all.
  2. It brings in extra columns and you need to form the data.
  3. It is limited in scope to only a few types.

Be careful before you consider trying to use mostly WCF with SSRS for reporting.

Upvotes: 4

Related Questions