WCF Interview Questions and Answers (209) - Page 8

Why it is dangerous to send a oneway message in WCF ?

It is dangerous to send a oneway message since there is no assurance that the operation is processed or not.


Thanks and Regards
Akiii
State 3 Duplex contract problems in WCF ?

(1) Threading problems can occur if either of the Callback channels are not empty.

(2) If the client and service has a long running work then this pattern doesn't scale very well. It can block the client or the service until the process is completes !

(3) It requires a connection back to the client. And there may be a chance to not connect back due to firewall and Network Address Translation problems.


Note :- It is always better to use Request / Response MEP rather than using Duplex method.

Thanks and Regards
Akiii
Which command is used to convert WSDL to a proxy

svcutil.exe command will convert the WSDL to a proxy class for our client

Open visual studio command prompt window
click on visual studio command prompt,set the current folder to the location where you want the generated proxy and configuration files to be created.

Run SvcUtil.exe to generate the output files.
Which type of securities are available in WCF?

NOTE: This is objective type question, Please click question title for correct answer.
Which are the available types of transport schemas in WCF?

NOTE: This is objective type question, Please click question title for correct answer.
Which is/are the possible value/s of ConcurrencyMode enumeration in WCF?

NOTE: This is objective type question, Please click question title for correct answer.
What is/are the type/s of Messaging pattern/s in WCF?

NOTE: This is objective type question, Please click question title for correct answer.
Which is/are available Instance Mode/s in WCF?

NOTE: This is objective type question, Please click question title for correct answer.
Which message encoding format/s is/are available in WCF?

NOTE: This is objective type question, Please click question title for correct answer.
What is MTOM?

MTOM stands for Message Transmission Optimization Mechanism and is an Interoperable standard that reduces the overhead for transfer large binary data in WCF. Its a mechanism for transmitting large binary attachments with SOAP messages as raw bytes.
What is the purpose of ExtensionDataObject in WCF? or How to make DataContract forward compatible?

A .NET serialization system supports backward-compatibility on custom data types naturally. However, sometimes we also need forward-compatibility for data types used in a WCF service.ExtensionDataObject property is used to achieve the Forward compatible in WCF.

Suppose that you have a service that exchanges some custom data types between clients. If one side updates the custom data type (adds some fields or properties) or uses a newer version, it is important to make sure that the other side can still work correctly with the updated data type instances without using the updated version of data.

Let see how can we achieve this in WCF.

1.First we need to make our Custom Data type to implement the IExtensibleDataObject interface.

[DataContract]

public class Employee: IExtensibleDataObject

{

[DataMember]

public string Name{ get; set; } [DataMember]

public string Address{ get; set; }

public ExtensionDataObject ExtensionData

{

get;

set;

}

}


2. Next we need to make sure that we haven't enabled the IgnoreExtensionDataObject property on ServiceBehaviorAttribute applied on your WCF service .This property is disabled by default.
What is the difference between a standard void operation and a one-way operation?

Suppose you have the following ServiceContract implemented:

[ServiceContract]
public interface IMyTask
{
[OperationContract(IsOneWay=false)]
void MyTask();
[OperationContract(IsOneWay = true)]
void MyTaskOneWay();
}

By invoking the two operations from the client side and capturing the HTTP message, we can get different response messages.

The normal void operation will return HTTP 200 status code and the complete SOAP Response in the body and the one-way operation will only return a HTTP 202 Accepted status header. This indicates that the one-way operation call gets finished as long as the
server side received the request, while the normal void operation will wait for the server side to execute and return the response data.
Which of the following properties you should enable, so can your service will expose its metadata through HTTP-GET

NOTE: This is objective type question, Please click question title for correct answer.
Which standard binding you would be use if your service will hosted on the same computer as the client ?

NOTE: This is objective type question, Please click question title for correct answer.
What is RoundTripping ?

A client with an older version (v1.0) of a data contract can communicate with a service with a newer version(v2.0) of the same data contract, or a client with a newer version of a data contract can communicate with an older version of the same data contract. this new-to-old-to-new interaction is called versioning roundtrip.

Round-tripping guarantees that no data is lost. WCF does have some built-in support it (IExtensibleDataObject interface).
In WCF, which is the default place for maintain session state ?

NOTE: This is objective type question, Please click question title for correct answer.
You want to use performance monitor to track the no of rejected messages in your developed WCF application.

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories