InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How Do We Customize Data Contract Names For Generics Types? |
|
Answer» We can customize the generic datacontract names by allowing parameters. FIND the Example below [DataContract(NAME = "Shape_{1}_brush_and_{0}_shape")] Here, the Data Contract Name is "Shape_RedBrush_brush_and_Square_shape” {0} - First Parameter in the generic type. {1} - SECOND Parameter in the generic type. We can customize the generic datacontract names by allowing parameters. Find the Example below [DataContract(Name = "Shape_{1}_brush_and_{0}_shape")] Here, the Data Contract Name is "Shape_RedBrush_brush_and_Square_shape” {0} - First Parameter in the generic type. {1} - Second Parameter in the generic type. |
|
| 2. |
What Is Data Contract Equivalence? |
|
Answer» Two DATA contracts are said to be equivalent, if they satisfy the following conditions.
Ex: The following two data contracts are equal. [DataContract] Two data contracts are said to be equivalent, if they satisfy the following conditions. Ex: The following two data contracts are equal. [DataContract] |
|
| 3. |
What Is The Use Of Is Required Property In Data Contracts? |
|
Answer» Data CONTRACTS, is used to DEFINE Required or NonRequired data members. It can be done with a property named IsRequired on DataMember ATTRIBUTE. [DataContract] Data Contracts, is used to define Required or NonRequired data members. It can be done with a property named IsRequired on DataMember attribute. [DataContract] |
|
| 4. |
What Does A Windows Communication Foundation, Or Wcf, Service Application Use To Present Exception Information To Clients By Default? |
|
Answer» However, the SERVICE cannot RETURN a .NET EXCEPTION to the client. The WCF service and the client COMMUNICATE by passing SOAP messages. If an exception occurs, the WCF runtime serializes the exception into XML and passes that to the client. However, the service cannot return a .NET exception to the client. The WCF service and the client communicate by passing SOAP messages. If an exception occurs, the WCF runtime serializes the exception into XML and passes that to the client. |
|
| 5. |
Can We Overload Methods In Wcf Service Or Web Service? |
|
Answer» Yes for a WCF Service use the Name property of OperationContractAttribute class [ServiceContract]
//[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [WebMethod] Yes for a WCF Service use the Name property of OperationContractAttribute class example: [ServiceContract] //[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [WebMethod] |
|
| 6. |
Advantages Of Hosting Wcf In Iis? |
Answer»
|
|
| 7. |
What Are The Different Wcf Binding Available? |
Answer»
|
|
| 8. |
What Are The Different Platforms Where We Can Host Wcf Service ? |
|
Answer» WCF Services can be HOSTED on following PLATFORMS WCF Services can be hosted on following platforms |
|
| 9. |
What Is Service Host Factory In Wcf? |
| Answer» | |
| 10. |
What Are Tha Advantages Of Hosting Wcf Service In Was? |
|
Answer» WAS (Windows ACTIVATION SERVICE) is a component of IIS 7.0. FOLLOWING are few advantages :
WAS (Windows Activation Service) is a component of IIS 7.0. Following are few advantages : |
|
| 11. |
In Wcf Which Bindings Supports The Reliable Session? |
|
Answer» In WCF, following BINDINGS SUPPORTS the reliable session
In WCF, following bindings supports the reliable session |
|
| 12. |
What Is Address Header In Wcf? |
|
Answer» Address Header contains the information which is sent with every request, it can be used by either end point service or any intermediate DEVICE for determining any routing logic or processing logic. WCF provides AddressHeader CLASS for this PURPOSE. Example : AddressHeader addressHeader= AddressHeader.CreateAddressHeader("Name of the header", "Information included in header "); Once the AddressHeader instance is created, it can be ASSOCIATED with end point instance as follows : EndpointAddress endpoint = NEW EndpointAddress(new Uri("http://myserver/myservice"), addressHeader); Address Header contains the information which is sent with every request, it can be used by either end point service or any intermediate device for determining any routing logic or processing logic. WCF provides AddressHeader class for this purpose. Example : AddressHeader addressHeader= AddressHeader.CreateAddressHeader("Name of the header", "Information included in header "); Once the AddressHeader instance is created, it can be associated with end point instance as follows : EndpointAddress endpoint = new EndpointAddress(new Uri("http://myserver/myservice"), addressHeader); |
|
| 13. |
How To Set The Instancing Mode In Wcf Service? |
|
Answer» In WCF, instancing mode is set at SERVICE level. For ex. //Setting PerSession INSTANCE mode In WCF, instancing mode is set at service level. For ex. //Setting PerSession instance mode |
|
| 14. |
Which Bindings In Wcf Support The Message Streaming? |
|
Answer» FOLLOWING BINDINGS SUPPORTS the STREAMING in WCF:
Following bindings supports the streaming in WCF: |
|
| 15. |
Which Are The 3 Types Of Transactions Manager Wcf Supports? |
|
Answer» WCF SUPPORTS following 3 types of transactions MANAGERS:
WCF supports following 3 types of transactions managers: |
|
| 16. |
How The Concurrency Mode Is Specified In Wcf Service? |
|
Answer» The concurrency MODE is specified using the ServiceBehavior attribute on the class that IMPLEMENTS the service. EX. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single)] There are 3 possible values of ConcurrencyMode enumeration
The concurrency mode is specified using the ServiceBehavior attribute on the class that implements the service. Ex. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single)] There are 3 possible values of ConcurrencyMode enumeration |
|
| 17. |
What Is Abc Of Wcf? |
|
Answer» ABC is the three building blocks of WCF and they are known as A Address (Where): Address tells us where to find the services, LIKE url B Bindings (How): Bindings tells us how to find the services or using which protocols finds the services (SOAP, HTTP, TCT etc.) C CONTACTS (What): Contracts are an agreement between the consumer and the SERVICE providers that explains what parameters the service expects and what return values it gives. ABC is the three building blocks of WCF and they are known as A Address (Where): Address tells us where to find the services, like url B Bindings (How): Bindings tells us how to find the services or using which protocols finds the services (SOAP, HTTP, TCT etc.) C Contacts (What): Contracts are an agreement between the consumer and the service providers that explains what parameters the service expects and what return values it gives. |
|
| 18. |
Which Protocol Is Used For Platformindependent Communication? |
|
Answer» SOAP (Simple Object Access PROTOCOL), which is directly SUPPORTED from WCF (WINDOWS Communication Foundation). SOAP (Simple Object Access Protocol), which is directly supported from WCF (Windows Communication Foundation). |
|
| 19. |
What Is The Purpose Of Base Address In Wcf Service? How It Is Specified? |
|
Answer» When multiple endpoints are associated with WCF service, base address (one primary address) is ASSIGNED to the service, and relative ADDRESSES are assigned to each endpoint. Base address is specified in <host> element for each service. E.g. <configuration> When multiple endpoints are associated with WCF service, base address (one primary address) is assigned to the service, and relative addresses are assigned to each endpoint. Base address is specified in <host> element for each service. E.g. <configuration> |
|
| 20. |
What Is The Difference Between Xmlserializer And The Datacontractserializer? |
Answer»
|
|
| 21. |
What Is Fault Contracts In Wcf? |
|
Answer» Fault Contracts is the way to handle exceptions in WCF. The problem with exceptions is that those are technology specific and therefore cannot be passed to other END because of interoperability issue. (Means either from Client to Server or viceversa). There must be another way representing the exception to support the interoperability. And here the SOAP Faults comes into the picture. Soap faults are not specific to any particular technology and they are based on industry standards. To support SOAP Faults WCF provides FaultException CLASS. This class has two forms:
WCF service also provides FaultContract attribute so that developer can specify which fault can be sent by the operation (method). This attribute can be applied to operations only. Fault Contracts is the way to handle exceptions in WCF. The problem with exceptions is that those are technology specific and therefore cannot be passed to other end because of interoperability issue. (Means either from Client to Server or viceversa). There must be another way representing the exception to support the interoperability. And here the SOAP Faults comes into the picture. Soap faults are not specific to any particular technology and they are based on industry standards. To support SOAP Faults WCF provides FaultException class. This class has two forms: WCF service also provides FaultContract attribute so that developer can specify which fault can be sent by the operation (method). This attribute can be applied to operations only. |
|
| 22. |
What Is Message Contract In Wcf? |
|
Answer» Message Contract : Message Contract is the way to control the SOAP messages, sent and RECEIVED by the client and server. Message Contract can be used to ADD and to get the custom headers in SOAP message Because of Message Contract we can customize the PARAMETERS sent USING SOAP message between the server and client. Message Contract : Message Contract is the way to control the SOAP messages, sent and received by the client and server. Message Contract can be used to add and to get the custom headers in SOAP message Because of Message Contract we can customize the parameters sent using SOAP message between the server and client. |
|
| 23. |
What Is Datacontractserializer In Wcf? |
|
Answer» DATACONTRACTSERIALIZER is NEW WCF serializer. This is serialization ENGINE in WCF. DataContractSerializer translate the .NET framework OBJECTS into XML and viceversa. By default WCF uses DataContractSeriazer. DataContractSerializer is new WCF serializer. This is serialization engine in WCF. DataContractSerializer translate the .NET framework objects into XML and viceversa. By default WCF uses DataContractSeriazer. |
|
| 24. |
What Is Xml Infoset? |
|
Answer» The XML Information Set defines a data model for XML. It is an abstract set of CONCEPTS such as attributes and entities that can be used to describe a VALID XML document. According to the specification, "An XML document's information set consists of a number of information items; the information set for any wellformed XML document will contain at least a document information ITEM and several OTHERS." The XML Information Set defines a data model for XML. It is an abstract set of concepts such as attributes and entities that can be used to describe a valid XML document. According to the specification, "An XML document's information set consists of a number of information items; the information set for any wellformed XML document will contain at least a document information item and several others." |
|
| 25. |
What Is .svc File In Wcf? |
|
Answer» .svc file is a text file. This file is similar to our .ASMX file in web services. This file CONTAINS the DETAILS required for WCF service to run it successfully. This file contains following details :
Example of .svc file <%@ ServiceHost Language="C#/VB" DEBUG="true/false" CodeBehind="Service code files path" Service="ServiceName" .svc file is a text file. This file is similar to our .asmx file in web services. This file contains the details required for WCF service to run it successfully. This file contains following details : Example of .svc file <%@ ServiceHost Language="C#/VB" Debug="true/false" CodeBehind="Service code files path" Service="ServiceName" |
|
| 26. |
What Is The Messaging Pattern? Which Messaging Pattern Wcf Supports? |
|
Answer» Messaging Pattern : Messaging patterns describes how client and server should exchange the MESSAGE. There is a protocol between client and server for sending and receiving the message. These are ALSO called Message Exchange Pattern. WCF supports following 3 TYPES of Message Exchange Patterns
Messaging Pattern : Messaging patterns describes how client and server should exchange the message. There is a protocol between client and server for sending and receiving the message. These are also called Message Exchange Pattern. WCF supports following 3 types of Message Exchange Patterns |
|
| 27. |
In Wcf, Which Contract Is Used To Document The Errors Occurred In The Service To Client? |
|
Answer» FAULT CONTRACT is used to DOCUMENT the errors occurred in the service to CLIENT. Fault Contract is used to document the errors occurred in the service to client. |
|
| 28. |
What Is The Use Of Servicebehavior Attribute In Wcf ? |
|
Answer» ServiceBehaviour ATTRIBUTE is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too) There are three instance Context Mode in the WFC PerSession : This is used to CREATE a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a VARIABLE) PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every TIME a new instance of the service is created) Single : This is used to create only ONE instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients) ServiceBehaviour attribute is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too) There are three instance Context Mode in the WFC PerSession : This is used to create a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a variable) PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every time a new instance of the service is created) Single : This is used to create only one instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients) |
|
| 29. |
What Is A Soa Service? |
|
Answer» SOA is Service Oriented Architecture. SOA service is the ENCAPSULATION of a high level business concept. A SOA service is composed of three parts.
SOA is Service Oriented Architecture. SOA service is the encapsulation of a high level business concept. A SOA service is composed of three parts. |
|
| 30. |
Difference Between Wcf And Web Services? |
|
Answer» Web SERVICES
WCF WCF is flexible because its services can be hosted in different types of applications. The following lists several COMMON SCENARIOS for hosting WCF services:
Web Services WCF WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting WCF services: |
|
| 31. |
What Are The Various Ways Of Hosting A Wcf Service? |
|
Answer» SELF hosting the service in his own application domain. This we have already covered in the first section. The service comes in to EXISTENCE when you create the object of ServiceHost class and the service closes when you call the Close of the ServiceHost class. Host in application domain or process PROVIDED by IIS Server. Host in Application domain and process provided by WAS (WINDOWS Activation Service) Server. Self hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of ServiceHost class and the service closes when you call the Close of the ServiceHost class. Host in application domain or process provided by IIS Server. Host in Application domain and process provided by WAS (Windows Activation Service) Server. |
|
| 32. |
What Is Three Major Points In Wcf? |
|
Answer» We Should remember ABC. ADDRESS Specifies the LOCATION of the service which will be like HTTP://Myserver/MyService.Clients will use this location to communicate with our service. Binding Specifies how the two paries will communicate in term of transport and encoding and protocols CONTRACT Specifies the interface between client and the server.It's a simple interface with some ATTRIBUTE. We Should remember ABC. Address Specifies the location of the service which will be like http://Myserver/MyService.Clients will use this location to communicate with our service. Binding Specifies how the two paries will communicate in term of transport and encoding and protocols Contract Specifies the interface between client and the server.It's a simple interface with some attribute. |
|
| 33. |
What Is The Difference Wcf And Web Services? |
|
Answer» Web services can only be invoked by HTTP (traditional webservice with .asmx). While WCF Service or a WCF component can be invoked by any protocol (like http, tcp etc.) and any transport type. Second web services are not flexible. However, WCF Services are flexible. If you make a new version of the service then you need to just expose a new END. Therefore, services are agile and which is a very practical approach looking at the current BUSINESS trends. We develop WCF as contracts, interface, OPERATIONS, and DATA contracts. As the developer we are more focused on the business logic services and need not worry about channel stack. WCF is a unified programming API for any kind of services so we create the service and USE configuration information to set up the communication mechanism like HTTP/TCP/MSMQ etc Web services can only be invoked by HTTP (traditional webservice with .asmx). While WCF Service or a WCF component can be invoked by any protocol (like http, tcp etc.) and any transport type. Second web services are not flexible. However, WCF Services are flexible. If you make a new version of the service then you need to just expose a new end. Therefore, services are agile and which is a very practical approach looking at the current business trends. We develop WCF as contracts, interface, operations, and data contracts. As the developer we are more focused on the business logic services and need not worry about channel stack. WCF is a unified programming API for any kind of services so we create the service and use configuration information to set up the communication mechanism like HTTP/TCP/MSMQ etc |
|
| 34. |
What Are Various Ways Of Hosting Wcf Services? |
|
Answer» There are three MAJOR ways of hosting a WCF services
There are three major ways of hosting a WCF services |
|
| 35. |
What Are The Main Components Of Wcf? |
|
Answer» The MAIN components of WCF are
The main components of WCF are |
|
| 36. |
What Was The Code Name For Wcf? |
|
Answer» The code NAME of WCF was INDIGO . WCF is a unification of .NET FRAMEWORK communication technologies which unites the following technologies: The code name of WCF was Indigo . WCF is a unification of .NET framework communication technologies which unites the following technologies: |
|
| 37. |
How To Deal With Operation Overloading While Exposing The Wcf Services? |
|
Answer» By default overload operations (methods) are not supported in WSDL based operation. However by using Name PROPERTY of OperationContract attribute, we can deal with operation OVERLOADING scenario. [ServiceContract] Notice that both method name in the above interface is same (Add), however the Name property of the OperationContract is DIFFERENT. In this case client proxy will have two methods with different name AddInt and AddDouble. By default overload operations (methods) are not supported in WSDL based operation. However by using Name property of OperationContract attribute, we can deal with operation overloading scenario. [ServiceContract] Notice that both method name in the above interface is same (Add), however the Name property of the OperationContract is different. In this case client proxy will have two methods with different name AddInt and AddDouble. |
|
| 38. |
How To Set The Timeout Property For The Wcf Service Client Call? |
|
Answer» The timeout property can be set for the WCF Service client call using BINDING TAG. <client> If no timeout has been specified, the default is considered as 1 MINUTE. The timeout property can be set for the WCF Service client call using binding tag. <client> If no timeout has been specified, the default is considered as 1 minute. |
|
| 39. |
How To Configure Reliability While Communicating With Wcf Services? |
|
Answer» RELIABILITY can be configured in the CLIENT config file by adding reliableSession under binding tag. <system.serviceModel> Reliability is supported by FOLLOWING bindings only NetTcpBinding Reliability can be configured in the client config file by adding reliableSession under binding tag. <system.serviceModel> Reliability is supported by following bindings only NetTcpBinding |
|
| 40. |
What Is Transport And Message Reliability? |
|
Answer» Transport reliability (such as the one offered by TCP) offers pointtopoint GUARANTEED delivery at the network packet level, as well as guarantees the order of the packets. Transport reliability is not resilient to dropping network connections and a variety of other COMMUNICATION problems. MESSAGE reliability DEALS with reliability at the message level independent of how many packets are required to deliver the message. Message reliability provides for endtoend guaranteed delivery and order of messages, regardless of how many intermediaries are involved, and how many network hops are required to deliver the message from the client to the service. Transport reliability (such as the one offered by TCP) offers pointtopoint guaranteed delivery at the network packet level, as well as guarantees the order of the packets. Transport reliability is not resilient to dropping network connections and a variety of other communication problems. Message reliability deals with reliability at the message level independent of how many packets are required to deliver the message. Message reliability provides for endtoend guaranteed delivery and order of messages, regardless of how many intermediaries are involved, and how many network hops are required to deliver the message from the client to the service. |
|
| 41. |
What Are Different Elements Of Wcf Srevices Client Configuration File? |
|
Answer» WCF Services client CONFIGURATION file contains ENDPOINT, ADDRESS, binding and contract. A sample client CONFIG file LOOKS like <system.serviceModel> WCF Services client configuration file contains endpoint, address, binding and contract. A sample client config file looks like <system.serviceModel> |
|
| 42. |
What Is Proxy And How To Generate Proxy For Wcf Services? |
|
Answer» The proxy is a CLR class that exposes a single CLR interface representing the service contract. The proxy provides the same operations as service's contract, but also has additional methods for managing the proxy life cycle and the connection to the service. The proxy COMPLETELY encapsulates every aspect of the service: its location, its implementation technology and runtime platform, and the communication transport. The proxy can be generated USING VISUAL Studio by right clicking Reference and clicking on Add Service Reference. This brings up the Add Service Reference dialog box, where you need to supply the base address of the service (or a base address and a MEX URI) and the namespace to contain the proxy. Proxy can also be generated by using SvcUtil.exe commandline utility. We need to provide SvcUtil with the HTTPGET address or the metadata exchange endpoint address and, optionally, with a proxy FILENAME. The default proxy filename is output.cs but you can also use the /out switch to indicate a different name. SvcUtil http://localhost/MyService/MyService.svc /out:Proxy.cs When we are hosting in IIS and selecting a port other than port 80 (such as port 88), we must provide that port number as part of the base address: SvcUtil http://localhost:88/MyService/MyService.svc /out:Proxy.cs The proxy is a CLR class that exposes a single CLR interface representing the service contract. The proxy provides the same operations as service's contract, but also has additional methods for managing the proxy life cycle and the connection to the service. The proxy completely encapsulates every aspect of the service: its location, its implementation technology and runtime platform, and the communication transport. The proxy can be generated using Visual Studio by right clicking Reference and clicking on Add Service Reference. This brings up the Add Service Reference dialog box, where you need to supply the base address of the service (or a base address and a MEX URI) and the namespace to contain the proxy. Proxy can also be generated by using SvcUtil.exe commandline utility. We need to provide SvcUtil with the HTTPGET address or the metadata exchange endpoint address and, optionally, with a proxy filename. The default proxy filename is output.cs but you can also use the /out switch to indicate a different name. SvcUtil http://localhost/MyService/MyService.svc /out:Proxy.cs When we are hosting in IIS and selecting a port other than port 80 (such as port 88), we must provide that port number as part of the base address: SvcUtil http://localhost:88/MyService/MyService.svc /out:Proxy.cs |
|
| 43. |
What Is The Address Formats Of The Wcf Transport Schemas? |
|
Answer» Address FORMAT of WCF TRANSPORT schema always follow [transport]://[machine or domain][:optional port] format. for example: HTTP Address Format http://localhost:8888 the way to read the above url is "Using HTTP, go to the machine called localhost, where on port 8888 someone is WAITING" When the port number is not specified, the default port is 80. TCP Address Format net.tcp://localhost:8888/MyService When a port number is not specified, the default port is 808: net.tcp://localhost/MyService NOTE: Two HTTP and TCP addresses from the same host can share a port, even on the same machine. IPC Address Format net.PIPE://localhost/MyPipe We can only open a named pipe once per machine, and therefore it is not possible for two named pipe addresses to share a pipe NAME on the same machine. MSMQ Address Format net.msmq://localhost/private/MyService net.msmq://localhost/MyService Address format of WCF transport schema always follow [transport]://[machine or domain][:optional port] format. for example: HTTP Address Format http://localhost:8888 the way to read the above url is "Using HTTP, go to the machine called localhost, where on port 8888 someone is waiting" When the port number is not specified, the default port is 80. TCP Address Format net.tcp://localhost:8888/MyService When a port number is not specified, the default port is 808: net.tcp://localhost/MyService NOTE: Two HTTP and TCP addresses from the same host can share a port, even on the same machine. IPC Address Format net.pipe://localhost/MyPipe We can only open a named pipe once per machine, and therefore it is not possible for two named pipe addresses to share a pipe name on the same machine. MSMQ Address Format net.msmq://localhost/private/MyService net.msmq://localhost/MyService |
|
| 44. |
How To Define A Service As Rest Based Service In Wcf? |
|
Answer» WCF 3.5 PROVIDES explicit support for RESTful COMMUNICATION USING a new binding named WebHttpBinding. The below code SHOWS how to EXPOSE a RESTful service [ServiceContract] WCF 3.5 provides explicit support for RESTful communication using a new binding named WebHttpBinding. The below code shows how to expose a RESTful service [ServiceContract] |
|
| 45. |
What Is Endpoint In Wcf? |
|
Answer» Every service must have ADDRESS that defines where the service resides, CONTRACT that defines what the service does and a Binding that defines how to communicate with the service. In WCF the RELATIONSHIP between Address, Contract and Binding is called Endpoint. Every service must have Address that defines where the service resides, Contract that defines what the service does and a Binding that defines how to communicate with the service. In WCF the relationship between Address, Contract and Binding is called Endpoint. |
|
| 46. |
What Is Binding And How Many Types Of Bindings Are There In Wcf? |
|
Answer» A binding defines how an endpoint communicates to the world. A binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint. WCF supports nine types of bindings.
A binding defines how an endpoint communicates to the world. A binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint. WCF supports nine types of bindings. |
|
| 47. |
Where We Can Host Wcf Services? |
|
Answer» EVERY WCF services must be hosted SOMEWHERE. There are three WAYS of HOSTING WCF services. They are
Every WCF services must be hosted somewhere. There are three ways of hosting WCF services. They are |
|
| 48. |
What Are Contracts In Wcf? |
|
Answer» In WCF, all SERVICES expose contracts. The contract is a platformneutral and standard WAY of DESCRIBING what the service does. WCF defines four types of contracts. Service contracts: Describe which operations the client can perform on the service. There are two types of Service Contracts.
Data contracts: Define which data types are passed to and from the service. WCF defines implicit contracts for builtin types such as int and string, but we can easily define explicit optin data contracts for custom types. There are two types of Data Contracts.
Fault contracts: Define which errors are raised by the service, and how the service handles and propagates errors to its clients. Message contracts: Allow the service to interact directly with messages. Message contracts can be typed or untyped, and are useful in interoperability cases and when there is an existing message format we have to COMPLY with. In WCF, all services expose contracts. The contract is a platformneutral and standard way of describing what the service does. WCF defines four types of contracts. Service contracts: Describe which operations the client can perform on the service. There are two types of Service Contracts. Data contracts: Define which data types are passed to and from the service. WCF defines implicit contracts for builtin types such as int and string, but we can easily define explicit optin data contracts for custom types. There are two types of Data Contracts. Fault contracts: Define which errors are raised by the service, and how the service handles and propagates errors to its clients. Message contracts: Allow the service to interact directly with messages. Message contracts can be typed or untyped, and are useful in interoperability cases and when there is an existing message format we have to comply with. |
|
| 49. |
What Is Address In Wcf And How Many Types Of Transport Schemas Are There In Wcf? |
|
Answer» Address is a WAY of letting client know that where a service is located. In WCF, every service is ASSOCIATED with a UNIQUE address. This contains the location of the service and TRANSPORT schemas. WCF supports following transport schemas HTTP Address is a way of letting client know that where a service is located. In WCF, every service is associated with a unique address. This contains the location of the service and transport schemas. WCF supports following transport schemas HTTP |
|
| 50. |
What Is Service And Client In Perspective Of Data Communication? |
|
Answer» A SERVICE is a UNIT of FUNCTIONALITY EXPOSED to the WORLD. A service is a unit of functionality exposed to the world. |
|