Consume WCF from SSRS Report

Now we prepare to create our WCF Service. I create a new WCF Application Service. Then for demo purpose, I create a simple method for return dummy data:

public MemberValue[] Test(int number)
	return new[]
		new MemberValue { Member = "Temmy", Status = "Active"},
		new MemberValue { Member = "Low Ming Hua", Status = "Active"},
		new MemberValue { Member = "Yong Hui Leng", Status = "Active"},

The MemberValue class:

public class MemberValue
	public string Member { get; set; }
	public string Status { get; set; }

At the SSRS Report, we create a new Data Source to point on our web service. We choose to Use a connection embedded in my report then choose Select Connection Type as XML. Then on the Connection string, we write down our web service URL:

Set Connection string in Data Source Properties

Then we can create a new Dataset, choose to Use a dataset embedded in my report. Choose existing dataset. Then on the query, you can put:

<Method Name="Test" Namespace="">

Query and Method tag is a must. You put your method name in Method. While for the SoapAction tag, you can get this value from the XML tab on WCF Test Client when you already execute your request.

If your Web Service Method needs parameters from your report, you can pass the SSRS parameter to your method easily using dataset Parameters. If you define a parameter, your parameter name should be the same.

Then if you test your report, you can debug the process also:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.