Introduction
This tip gives information about a list of tools to test web / WCF service, and also gives information about consumption of online WCF Services in the client applications.
Background
After learning WCF services, I created and deployed services in local, but didn't get a chance to consume online WCF services. After knowing about the availability of online WCF services, I want to share information with everyone so that everyone can consume those WCF services for learning and testing.
The following tools are used to test services:
- WcfTestClient.exe -> Go to Visual Studio command prompt -> type wcftestclient.exe, this tool is used while implementing service
- SoapUI
- WcfStrom -> Useful to know metrics of the services
Using the Code
In this tip, I will show you consumption of WCF services in client applications.
I found IfscCodeWcfService which is running online. I tried to consume that live service in two client applications.
I created two projects:
- Web Client Application
- Desktop Client Application
Each application consists of 2 forms / pages:
- Displaying all banks list:
IfscCodeServiceRef.IifscCodeServiceClient serviceclient;
private void DisplayAllBanks_Load(object sender, EventArgs e)
{
serviceclient = new IfscCodeServiceRef.IifscCodeServiceClient();
dataGridView1.DataSource = serviceclient.GetAllBanks().ToList();
}
- Displaying
ifsccodes
list of selected bank:
IfscCodeServiceRef.IifscCodeServiceClient serviceclient;
private void IfscCodesByBankId_Load(object sender, EventArgs e)
{
serviceclient = new IfscCodeServiceRef.IifscCodeServiceClient();
dataGridView1.DataSource = serviceclient.FindIfscCodesByBankId(1).ToList();
}
For two applications, I implemented the same code that is the advantage of services.
Points of Interest
I understood the advantages of services while consuming heterogeneous applications and platforms, learned about end points, wsdl, tools of WCF services.
I tried to consume services from the site WcfSpro.
Consumed service for demo is Ifsc Code Service.