Sunday, June 28, 2009

Consuming WCF Services hosted in IIS7

To consume services we should conform before that whether there is services or not.
If Wcf services test it before using it with the command 'testwcfclient' along with hosted service path.

first.
1. Add the new website on the builded project and choose ASP.NET website Template
and Give appropriate name as you want.
2. Add reference of service which is hosted in IIS7 by clicking on "service reference"from add reference.

2. make simple asp page to access the services and write some code on .cs file of that page.
3. Dont forget to add reference in .cs page
eg. using ServiceReference1;

4. call services and use its function as in other class and object.
eg. MyCalculatorClient client = new MyCalculatorClient();

here MyCalulator is service name:

5. after writing some code to consume services, build the whole solution and then view the project on browser.

new page will be open in browser and you can use that service by putting the value and accessing result.

Thus you can use the WCF services hosted in II7.

Thursday, June 25, 2009

Difference between string and String in C#

There is such difference in string and String. These can be apply for the same purpose. The only difference between these is String can be used as identifier but string can not.