Q & A - WCF Questions & Answers

 

Q&A 1.

What is the namespace used for WCF?

The namespace used for WCF is System.ServiceModel.

Q&A 2.

How we can generate proxy for WCF?

Proxies can generated using below methods.

  1. Using Visual Studio
  2. Using SvcUtil.exe

Q&A 3.

How to generate proxies using dotnet utility Svcutil.exe in WCF?

SvcUtil is a command line utility. We can write the below command to generate proxy.

svcutil /d: http://<myserviceurl>/out:<file_name>.cs /config:<file_name>.config

Q&A 4.

What are default endpoints in WCF?

If service does not have any endpoints either in config or in program, by default WCF adds up one endpoint to the service created.

Q&A 5.

What are bindings used for metadata configuration in WCF?

Below are the list of bindings that are used for metadata configuration.

  1. mexHttpBinding
  2. mexNamedPipeBinding
  3. mexHttpsBinding
  4. mexTcpBinding

Q&A 6.

How can we test WCF application without creating client application?

Tool called wcftestclient.exe is used for testing the WCF service without creating a client application. We can open this tool from visual studio command prompt.

Q&A 7.

Can method overloading be made in WCF? Explain this having an example.

Yes we can have method overloading in WCF.

For ex:

[ServiceContract]
interface ICalculator
{
 [OperationContract(Name = "AddInteger")]
 int Add(int pararm1,int pararm2);
 [OperationContract(Name = "AddDouble")]
 double Add(double pararm1,double pararm2);
}

Q&A 8.

What are Fault Contracts in WCF?

This contract is used to raise the error from service side or in simple words client will come to know about the service error from fault contract.


Related Quiz Content

x
This website is using cookies to make user experience of the site better. More info. OK