Testking Web 70-513 CSHARP Exam - Windows Communication Foundation Development with Microsoft .NET Framework 4 (CSHARP)

Document Sample
Testking Web 70-513 CSHARP Exam - Windows Communication Foundation Development with Microsoft .NET Framework 4 (CSHARP) Powered By Docstoc
					                                                   Total Questions: 263




    Questions and Answers
                                          with
         Detailed Explanations and Objectives




                              Vendor: Microsoft
                    Certification(s): MCTS, MCPD
                     Exam Code: 70-513-CSHARP
                   Exam Name:
      TS: Windows Communication Foundation
    Development with Microsoft .NET Framework 4
                     (CSHARP)
                            Total Questions: 263




http://www.testkingweb.com/microsoft-70-513.html            Page 1 of 198
                                                                          Total Questions: 263

Objectives

  A     Creating Services (20%)

  B     Hosting and Configuring Services (18%)

  C     Securing Services (17%)

  D     Managing the Service Instance Life Cycle (13%)

  E     Monitoring and Troubleshooting Distributed Systems (14%)

  F     Consuming Services (18%)


Note: Relevant objective of each question is mentioned with Question number.




http://www.testkingweb.com/microsoft-70-513.html                                   Page 2 of 198
                                                                               Total Questions: 263

QUESTION NO: 1(A)
Which of the following properties of the MessageContractAttribute class indicates whether to control
the name and namespace used for the wrapper element?

A. WrapperNamespace
B. ProtectionLevel
C. IsWrapped
D. WrapperName

ANSWER: C


QUESTION NO: 2(A)
Which of the following terms is used to specify the structure of data included in the payloads of
messages flowing in and out of the service?

A. Service Level Agreement (SLA)
B. Message contract
C. Data contract
D. Service contract

ANSWER: C

EXPLANATION:
A contract is an agreement between two services. The contract specifies which message types will be
used to process a message. An application uses message types to accomplish a particular task through a
contract. There are three types of core contracts, which are as follows:
     Service contract: It is used to indicate which operations the service makes available, to be
        invoked as request messages are sent to the service from the client.
     Data contract: It is used to specify the structure of the data included in the payloads of the
        messages flowing in and out of the service.
     Message contract: It is used to control the headers that appear in the messages, and how the
        messages are structured.

Answer option a is incorrect. A service level agreement (SLA) is a part of a service contract where the
level of service is formally defined. It is a negotiated agreement between two parties where one is the
customer and the other is the service provider. This can be a formal or informal legally binding contract.
The term SLA is also used to refer to the contracted delivery time (of the service) or performance. As an
example, Internet Service Providers will commonly include service level agreements within the terms of
their contracts with customers to define the level(s) of service being sold in plain language terms
(typically the (SLA) will in this case have a technical definition in terms of MTTF, MTTR, various data
rates, etc.).


Answer option b is incorrect. A Message contract enables a user to use a type for a parameter or return
value that serializes directly into the precise SOAP message structure. It has at most one parameter and
one return value, where both the types are message types.


http://www.testkingweb.com/microsoft-70-513.html                                             Page 3 of 198
                                                                                Total Questions: 263


Answer option d is incorrect. Service contract: It is used to indicate the operations which the service
makes available to be invoked, as request messages are sent to the service from the client.

REFERENCE:
http://msdn.microsoft.com/en-us/library/ms733127.aspx


QUESTION NO: 3(A)
Which of the following properties of the OperationContractAttribute class is used to prevent clients
from calling a particular service operation prior to other operations?

A. IsInitiating
B. IsTerminating
C. IsOneWay
D. ProtectionLevel

ANSWER: A


QUESTION NO: 4(A)
John works as a Windows Application Developer for Testking Web Inc. He has been tasked to upgrade
an old application based on Framework 2.0 to .NET Framework 4.0 application. In the process of
upgrading the application, he is changing most of the data processing and business logic to WCF
services. This means he should have complex data types that will need to be sent through the WCF
service. What will he do to ensure that the WCF service can handle complex data types?

A. Prototype the complex data types on the client side only.
B. Modify the operations contract to use the [ComplexDataTypeContract] attribute rather than the
   [DataContract] attribute.
C. WCF services can handle both simple and complex data types with no special coding. He does not
   require any extra step.
D. Employ [KnownType(typeof())] attribute with the data contract.

ANSWER: D

EXPLANATION:
In order to manage complex data types, he should employ [KnownType(typeof())] attribute with the
data contract. [KnownType] attribute is used with structures, classes, interfaces, and other complex data
types. KnownTypeAttribute class permits to specify, in advance, the types that should be included for
consideration during deserialization.

Answer option a is incorrect. In this case, he does not have to prototype the complex data types on the
client side.

Answer option b is incorrect. This is invalid as there is no such [ComplexDataTypeContract] attribute in


http://www.testkingweb.com/microsoft-70-513.html                                              Page 4 of 198
                                                                                 Total Questions: 263

the data contract.

Answer option c is incorrect. He requires extra steps of using [KnownType] attribute for complex data
types.


What is a data contract?
A data contract is an official agreement between a service and a client that abstractly describes the data
to be exchanged. Therefore, in order to communicate, the client and the service do not have to share
the identical types, they share only the identical data contracts. A data contract specifically defines, for
each and every parameter or return type, what data is serialized (turned into XML) to be exchanged.

By default, WCF uses a serialization engine knows as Data Contract Serializer that is used to serialize and
deserialize data. All .NET Framework primitive types, such as integers and strings, and certain types
treated as primitives, such as DateTime and XmlElement, can be serialized without any preparation and
are considered as having default data contracts. A lot of .NET Framework types also have existing data
contracts.

REFERENCE:
msdn, Content: http://msdn.microsoft.com/en-us/library/ms730167.aspx


QUESTION NO: 5(A)
Which of the following contracts enables a user to use a type for a parameter, or a return value, that
serializes directly into the precise SOAP message structure?

A. Data contract
B. Message contract
C. Operation contract
D. Service contract

ANSWER: B


QUESTION NO: 6(A)
Which of the following attributes will you use on a class that defines the data types or contracts to be
added to a SOAP header or body?

A. DataContract
B. MessageContract
C. ServiceContract
D. OperationContract

ANSWER: B


QUESTION NO: 7(A)


http://www.testkingweb.com/microsoft-70-513.html                                              Page 5 of 198
                                                                              Total Questions: 263

WCF does not perform processing of any other Soap header attributes on incoming messages, except
the __________ Soap header attribute.

A. Relay
B. MustUnderstand
C. Role
D. Actor

ANSWER: B


QUESTION NO: 8(A)
John works as a Developer for Testking Web Inc. He is creating a WCF based Web service on 4.0
Framework for his company. The Web service does not acknowledge messages larger than 68 KB that
can be processed by the binding process. He needs to ascertain that the Web service can recognize
messages that are larger than 68 KB without generating errors in the future. What should he do to
accomplish the task?

A. Raise the value of maxRequestLength on the httpRuntime element.
B. Raise the value of MaxQueryStringLength on the httpRuntime element.
C. Raise the value of maxReceivedMessageSize on the endpoint binding.
D. Raise the value of MaxBufferSize on the endpoint binding.

ANSWER: C

EXPLANATION:
To ascertain that the Web service recognizes messages that are larger than 68 KB without generating
errors in the future, raise the value of maxReceivedMessageSize on the endpoint binding. The
maxReceivedMessageSize property gets or sets the maximum size for a message that can be processed
by the binding process.

Answer option a is incorrect. This property gets or sets the maximum request size but those messages
that are not processed by the binding process.

Answer option b is incorrect. This property gets or sets the maximum possible length, in number of
characters or words, of a query string in an HTTP request.

Answer option d is incorrect. This property gets or sets the maximum size of the buffer to use.

REFERENCE:
http://geekswithblogs.net/niemguy/archive/2007/12/11/wcf-maxstringcontentlength-maxbuffersize-
and-maxreceivedmessagesize.aspx


QUESTION NO: 9(A)
Which of the following terms describes the protocol of message exchange with which a consumer must
engage to converse properly with the service?


http://www.testkingweb.com/microsoft-70-513.html                                            Page 6 of 198
                                                                              Total Questions: 263

A. SOAP
B. MEPs
C. OneWay
D. Duplex

ANSWER: B


QUESTION NO: 10(A)
Which of the following classes is used to create and manage channels that are used by the clients, so
that messages can be sent to service endpoints?

A. DataServiceHost
B. ETagAttribute
C. ChannelFactory
D. ServiceOperationRights

ANSWER: C


QUESTION NO: 11(A)
John works as a Developer for Testking Web Inc. The SOAP consists of a SOAP envelope that is used to
define an overall framework to express what is in a message, who should deal with it, and whether it is
optional or mandatory. The following is an example of a SOAP envelope:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope">
<s:Header>
<h:StoreId xmlns:h="http://www.Testking Web.com">6596</s:Header>
<s:Body>
<CheckWholeStockRequestPermission xmlns="http://www.Testking Web.com">
<ItemId>3545<itemid>
</ CheckWholeStockRequestPermission>
</s: Body>
</s:Envelope></itemid>


He requires creating a message contract that constructs the SOAP envelope. Which of the following
code segments should he use to accomplish the task?

A. [MessageContract(WrapperNamespace="http://www.Testking Web.com")]
   public class CheckWholeStockRequestPermission {
   [MessageHeader(Namespace="http://www.Testking Web.com")]
   public int StoreItemld{get; set;}
   [MessageBodyMember(Namespace="http://www Testking Web.com")]
   public int ucltemld{get; set;}
   }


http://www.testkingweb.com/microsoft-70-513.html                                           Page 7 of 198
                                                                              Total Questions: 263

B. [MessageContract(WrapperName="http://www.Testking Web.com")]
   public class CheckWholeStockRequestPermission
   {
   [MessageHeader(Namespace="http://www.Testking Web.com")]
   public int StoreItemld{get; set.}
   [MessageBodyMember(Namespace="http://www.Testking Web.com")]
   public int ucItemld{get set;)
   }
C. [MessageContract(ProtectionLevel="http://www.Testking Web.com")]
   public class CheckWholeStockRequestPermission
   {
   [MessageHeader(Namespace="http://www.Testking Web.com")]
   public int StoreItemld{get; set.}
   [MessageBodyMember(Namespace="http://www.Testking Web.com")]
   public int ucItemld{get set;)
   }
D. [MessageContract(IsWrapped="http://www.Testking Web.com")]
   public class CheckWholeStockRequestPermission
   {
   [MessageHeader(Namespace="http://www.Testking Web.com")]
   public int StoreItemld{get; set.}
   [MessageBodyMember(Namespace="http://www.Testking Web.com")]
   public int ucItemld{get set;)
   }

ANSWER: A

EXPLANATION:
The best way of creating a message contract that constructs the SOAP envelope is as follows:

[MessageContract(WrapperNamespace=http://www.Testking Web.com)]
public class CheckWholeStockRequestPermission {
[MessageHeader(Namespace=http://www.Testking Web.com)]
public int StoreItemld{get; set;}
[MessageBodyMember(Namespace=http://www Testking Web.com)]
public int ucltemld{get; set;}
}


What is a Message contract?
A Message contract enables a user to use a type for a parameter or return value that serializes directly
into the precise SOAP message structure. It has at most one parameter and one return value, where
both the types are message types.
WrapperNamespace gets or sets the namespace of the message body wrapper element.
MessageBodyMember is used to construct one or more SOAP body elements that can be ordered using
the System.ServiceModel.MessageBodyMember.Order property of the attribute.



http://www.testkingweb.com/microsoft-70-513.html                                           Page 8 of 198
                                                                                Total Questions: 263

Answer option b is incorrect. This option is invalid as creating a message contract that constructs the
SOAP envelope does not involve the WrapperName property. The WrapperName property is used to get
or set the name of the wrapper element of the message body.

Answer option c is incorrect. This option is invalid as the ProtectionLevel property is used here which is
not applicable but is used to get or set a value that determines whether the message must be
encrypted, signed, or both.

Answer option d is incorrect. This option is invalid as the IsWrapped property is used here which is used
in segments to get or set a value that determines whether the message body has a wrapper element or
not.

REFERENCE:
http://msdn.microsoft.com/en-us/library/ms586728.aspx


QUESTION NO: 12(A)
John works as a Windows Developer for Testking Web Inc. The company uses Visual Studio .NET 2010 as
its application development platform. John has been given the task to create a WCF application based
on .NET 4.0 as quickly as possible. The WCF application will handle the sales department of the
company. John is using messaging styles in different contracts to control the messaging process. John is
required to write the following code:

public class InventoryTransaction
{

[MessageBodyMember()]
public Operation operation;
[MessageBodyMember()]
public DateTime transactionDate;
[MessageBodyMember()]
private int sourceID;
[MessageBodyMember()]

public int WareHouseID;
}

What is invalid in the above coding?

A. The class must include MessageHeaderAttribute.
B. The class definition must be preceded with the MessageContract() attribute.
C. The /messageContract command option must be specified.
D. The class must include MessageBodyMemberAttribute.

ANSWER: B

EXPLANATION:


http://www.testkingweb.com/microsoft-70-513.html                                              Page 9 of 198
                                                                               Total Questions: 263

In the above mentioned code, John must precede the class definition with the MessageContract()
attribute to indicate that this is a message contract. The MessageContract() attribute creates a message
contract enabling a user to use a type for a parameter or return a value that serializes directly into a
specified SOAP message structure.

Answer option A is incorrect. MessageHeaderAttribute is used to put Operation in a SOAP header.

Answer option C is incorrect. The /messageContract command is used to force the generation of the
message contract.

Answer option D is incorrect. MessageBodyMemberAttribute is used to determine whether a member is
serialized as an element inside the SOAP body or not.


What is a Message contract?
A Message contract enables a user to use a type for a parameter or return value that serializes directly
into the precise SOAP message structure. It has at most one parameter and one return value, where
both the types are message types.


How is a Message contract defined?
A Message contract is defined by applying MessageContractAttribute ([MessageContract]) attribute to a
class type. The [MessageHeader] attribute is applied to those members of the class type to make into
SOAP headers. Similarly, the [MessageBodyMember] attribute is then applied to those members of the
class type, which are made into parts of the SOAP body of the message.

REFERENCE:
http://msdn.microsoft.com/en-us/library/ms751464(v=VS.90).aspx


QUESTION NO: 13(A)
John works as a Windows Application Developer for Testking Web Inc. Windows Communication
Foundation (WCF) service 4.0 is self-hosted in a console application interface. The WCF service
implements the IDataAccess contract which is mentioned in the My_App namespace. The service is
implemented in a class named Data_Access_App_Service which implements the IDataAccess interface
feature and is also defined in the My_App namespace. The hosting code is described as follows.

Line numbers are given for reference only.

01 static void Main(string[] args)
02 {
03 ServiceHost hosting;
04
05 hosting.Open();
06 Console.Read Line();
07 hosting.Close()
08 }


http://www.testkingweb.com/microsoft-70-513.html                                           Page 10 of 198
                                                                                Total Questions: 263

He needs to generate and manage a ServiceHost instance and assign it to the host variable; he also
needs to instantiate the service host. Which of the following lines of code should he insert at line 04 so
as to accomplish the task?

A. hosting = new ServiceHost(typeof(IDataAccess));
B. hosting = new ServiceHost(typeof(DataAccessService));
C. hosting = new ServiceHost("My_App.DataAccess");
D. hosting = new ServiceHost("My_App.DataAccessService");

ANSWER: B

EXPLANATION:
To generate and manage a ServiceHost instance and assign it to the host variable and also to instantiate
the service host, the line of code that should be added is as follows:

hosting = new ServiceHost(typeof(DataAccessService));

DataAccessService helps in generating and managing a ServiceHost instance.

Answer options a , c , and d are incorrect. These options are invalid as they cannot generate and manage
the ServiceHost class instance.


What is the ServiceHost class?
The ServiceHost class is used to provide a host for services and to implement the host used by the WCF
service model programming model. It is used to configure and expose a service used by client
applications only when Internet Information Services (IIS) or Windows Activation Services (WAS) is not
used.

REFERENCE:
http://www.devx.com/codemag/Article/33655/1763/page/2


QUESTION NO: 14(A)
John works as a Windows Developer for Testking Web Inc. The company uses .NET 2010 Framework as
its application development platform. John has been given a task of creating WCF applications using
.NET Framework 4.0. The application development uses a transaction queue process. John is required to
permit all messages in the queue to implement different types of contracts. In this scenario, how will
John manage to successfully read and process all messages that are in the transaction queue?

Each correct answer represents a complete solution. Choose two.


A. State multiple endpoints that implement specific contracts.
B. State an endpoint for a service that implements all the contracts.
C. State many endpoints with different contracts; however, ensure that all endpoints exploit the


http://www.testkingweb.com/microsoft-70-513.html                                             Page 11 of 198
                                                                               Total Questions: 263

identical NetMsmqBinding objects.
D. State single endpoint that implements a single contract.

ANSWER: B AND C

EXPLANATION:
Messages in a queue can implement different contracts. In this case, it is necessary that one of the
following is true to successfully read and process all messages:
      Specifying an endpoint for a service that implements all the contracts. This is the recommended
        approach.
      Specifying many endpoints with different contracts; however, ensure that all the endpoints
        exploit the identical NetMsmqBinding object.

The dispatching logic in ServiceModel exploits a message pump that reads messages from the transport
channel for dispatch, which ultimately de-multiplexes messages based on the contract to different
endpoints.

A message pump is formed to listen a URI/Binding pair. The queue address is used as the Listen URI by
the queued listener. Having all the endpoints use the identical binding object ensures that a single
message pump is used to read the message and de-multiplex to relevant endpoints based on the
contract.


REFERENCE:
.NET Framework Development Center, Contents: Service Endpoints and Queue Addressing


QUESTION NO: 15(A)
Which of the following attributes of the <serviceMetaData> element should be configured to expose the
metadata from a service through HTTP?

A. httpGetEnabled
B. httpGetBinding
C. externalMetadataLocation
D. httpGetUrl

ANSWER: A


QUESTION NO: 16(A)
John works as a Developer for Testking Web Inc. He is creating a WCF based on Framework 4.0 to
process orders placed by the clients. The data contract for order of products is defined as follows:

[DataContract]
public class Order_Placed
{
[DataMember]


http://www.testkingweb.com/microsoft-70-513.html                                            Page 12 of 198
                                                                               Total Questions: 263

public string CreditCardHolderName { get; set;}
[DataMember]
public string ClientCreditCardNumber { get; set; }
}

He has the following requirements:
     Enable transmission of the contents of Order_Placed from the clients to the service.
     Ensure that the contents of ClientHolderName are not sent across the network in clear text.
     Ensure that the contents of ClientCreditCardNumber are accessible by the service to process the
        order placed by the clients.

He needs to implement the service to meet these requirements. What should he do to accomplish the
task?

A. Insert a DataProtectionPermission attribute to the ClientCreditCardNumber property and set the
   ProtectData property to true.
B. Alter the data type of ClientCreditCardNumber from string to SecureString.
C. Alter the data type of CreditCardHolderName from string to SecurityContext.
D. Alter DataContract to MessageContract in WCF and then set the ProtectionLevel property to
   SignAndEncrypt feature available.

ANSWER: D

EXPLANATION:
He should alter DataContract to MessageContract in WCF and then set the ProtectionLevel property to
the SignAndEncrypt feature available so as to implement the service and meeting all the above
mentioned requirements.


What is a contract?
A contract is an agreement between two services. The contract specifies which message types will be
used to process a message. An application uses message types to accomplish a particular task through a
contract. There are three types of core contracts, which are as follows:
     Service contract: It is used to indicate which operations the service makes available, to be
        invoked as request messages are sent to the service from the client.
     Data contract: It is used to specify the structure of the data included in the payloads of the
        messages flowing in and out of the service.
     Message contract: It is used to control the headers that appear in the messages, and how the
        messages are structured.


The ProtectionLevel property is used to specify the degree to which the contract binding requires
encryption, digital signatures, or both for endpoints that expose the contract service. The value set here
is the default value for all operation messages including faults.
SignAndEncrypt is used for message security purpose.

Answer option a is incorrect. The DataProtectionPermission attribute is used to control the ability to


http://www.testkingweb.com/microsoft-70-513.html                                           Page 13 of 198
                                                                                 Total Questions: 263

access the encrypted data and memory. The ProtectData property gets or sets a value determining
whether data can be encrypted using the ProtectedData class.

Answer option b is incorrect. SecureString is used to represent text that should be kept confidential.

Answer option c is incorrect. SecurityContext is used to encapsulate and propagate all security-related
data for execution contexts transferred across threads.

REFERENCE:
http://msdn.microsoft.com/en-us/library/ms730255.aspx


QUESTION NO: 17(A)
John works as a Windows Developer for Testking Web Inc. John has been given the task to create a
Windows Communication Foundation (WCF) application by using Microsoft .NET Framework 4.0. Data
contracts that have many data members use WCF applications. He needs this application to throw a
SerializationException error message if the data members are not present when a serialized instance of
the data contract is deserialized. What should he do to accomplish the task?

A. Set EmitDefaultValue of each data member to true.
B. Set the lsRequired property of each data member to true.
C. Set the Name property of each data member to true.
D. Set the Order property of each data member to true.

ANSWER: B

EXPLANATION:
The lsRequired property under System.Runtime.Serialization namespace function gets or sets a value
that initiates the serialization engine that the member must be present when reading or deserializing.

Answer option a is incorrect. This function gets or sets a value that is used to determine whether to
serialize the default value for a field or property being serialized.

Answer option c is incorrect. This function gets or sets a data member name.

Answer option d is incorrect. This function gets or sets the order of serialization and deserialization of a
member.


What is a data contract?
A data contract is a formal agreement between a service and a client in which the client abstractly
describes the data to be exchanged. For each parameter or return type, a data contract clearly defines
what data is serialized (turned into XML) to be exchanged.

REFERENCE:
http://msdn.microsoft.com/en-
us/library/system.runtime.serialization.datamemberattribute.isrequired.aspx


http://www.testkingweb.com/microsoft-70-513.html                                              Page 14 of 198
                                                                             Total Questions: 263


QUESTION NO: 18(A)
A messaging-style operation can have at most __________ where both types are message types.

A. Two parameters with null return value
B. One return value with no parameter
C. One parameter and one return value
D. Two parameters and one return value

ANSWER: C


QUESTION NO: 19(A)
John works as a Developer for Testking Web Inc. He is creating interfaces for WCF. A class named
TestWCF implements the following interface.

[ServiceContract]
public interface ITestService
{
[OperationContract]
DateTime GetServiceTime();
}

To permit the GetServiceTime method to return data in the JSON format, he needs to alter the WCF
application. Which of the following attributes should be inserted by him to the GetServiceTime method
to accomplish the task?

Choose and Reorder:

1. [WebInvokeAttribute(ResponseFormat=WebMessageFormat.Json, UriTemplatee/ServiceTime)]

2.   [WebGet(ResponseFormat=WebMessageFormat.Json, UriTemplatee/ServiceTime)]

3. [WebInvokeAttribute(ResponseFormat=WebMessageFormat.Json, UriTemplate=/ServiceTime)]

4. Construct a new svc file named AppJsonversion.svc with the following content.<%ServiceHost
   Service=TestWCF Factory=System.ServiceModel.ActivationWebScriptServiceHostFactory %>

5. Construct a new svc file named AppJsonversion.svc with the following content. <%ServiceHost
   Service=TestWCF Factory=System.ServiceModel.ActivationWebServiceHostFactory %>


ANSWER:
1. [WebGet(ResponseFormat=WebMessageFormat.Json, UriTemplatee/ServiceTime)]




http://www.testkingweb.com/microsoft-70-513.html                                         Page 15 of 198
                                                                                 Total Questions: 263

2. Construct a new svc file named AppJsonversion.svc with the following content. <%ServiceHost
   Service=TestWCF Factory=System.ServiceModel.ActivationWebServiceHostFactory %>


EXPLANATION:
To amend the application so as to permit the GetServiceTime method to return data formatted as JSON,
and when the requested URL ends in the /ServiceTime format, take the following steps:
     Insert the following attribute to the GetServiceTime method
       [WebGet(ResponseFormat=WebMessageFormat.Json, UriTemplate=/ServiceTime)]
     Construct a new svc file named AppJsonversion.svc with the following content. <%ServiceHost
       Service=TestWCF Factory=System.ServiceModel.ActivationWebServiceHostFactory%>

JavaScript Object Notation (JSON), pronounced Jason, is a lightweight computer data interchange
format. It is a text-based, human-readable format for representing simple data structures and
associative arrays (called objects).

The official Internet media type for JSON is application/json. The JSON file extension is .json.

The JSON format is often used for serialization, transmitting structured data over a network connection.
Its main application is in Asynchronous JavaScript and XML (AJAX) Web application programming, where
it serves as an alternative to the use of the XML format.

Although JSON was based on a subset of the JavaScript programming language and is commonly used
with that language, it is considered to be a language-independent data format. Code for parsing and
generating JSON data is readily available for a large variety of programming languages.
The WebGetAttribute class indicates that a service operation is a retrieval operation and can be called
by the Web programming model. Methods marked with the WebGet attribute are called using the HTTP
GET service. A user can cache the result of an HTTP GET request.


REFERENCE:
http://msdn.microsoft.com/en-us/library/bb299886.aspx


QUESTION NO: 20(A)
Fill in the blanks with an appropriate terms.

A WCF Service is composed of three parts: a ____________ that implements the service to be provided,
a __________________ to host the service, and one or more _____________ to which clients would
connect.


ANSWER:
A WCF Service is composed of three parts: a Service class that implements the service to be provided, a
host environment to host the service, and one or more endpoints to which clients would connect.

EXPLANATION:


http://www.testkingweb.com/microsoft-70-513.html                                             Page 16 of 198
                                                                                 Total Questions: 263

Windows Communication Foundation (WCF) is a Microsoft programming model for building connected
applications that use Web services to communicate with each other. Programmers use WCF to develop
applications that communicate across platforms and interoperate with existing systems and applications
in an organization. It enables developers to combine the various technologies available for building
distributed applications such as COM+ and .NET Enterprise services, Message Queuing, etc. WCF is
commonly used in server-based applications as well as client-based applications.


What is a WCF Service?
A WCF Service is composed of three parts: a Service class that implements the service to be provided, a
host environment to host the service, and one or more endpoints to which clients will connect. All
communications with the WCF service happens via the endpoints. The endpoints specify a Contract that
defines which methods of the Service class will be accessible via the endpoint; each endpoint may
expose a different set of methods. The endpoints also define a binding that specifies how a client will
communicate with the service and the address where the endpoint is hosted.

In Windows Vista, Windows Server 2008 and Windows 7 (OSs that include IIS 7), Windows Activation
Services can be used to host the WCF service. Otherwise the WCF service can be hosted in IIS, or it can
be self-hosted in any process by using the ServiceHost class, which is provided by WCF. A self-hosted
WCF service might be provided by a console-based application, a Windows Forms application, or a
Windows service.

REFERENCE:
http://msdn.microsoft.com/en-us/library/bb332338.aspx


QUESTION NO: 21(A)
Which of the following classes allows the user to discover available services?

A. DiscoveryClientBindingElement
B. DiscoveryClient
C. DiscoveryEndpoint
D. DiscoveryEndpointProvider

ANSWER: B

EXPLANATION:
The DiscoveryClient class allows the user to discover available services.

Answer option a is incorrect. DiscoveryClientBindingElement is a type of a binding element that can be
added to a client application to take advantage of the Discovery client channel.

Answer option c is incorrect. DiscoveryEndpoint is the standard discovery endpoint.

Answer option d is incorrect. DiscoveryEndpointProvider is used to provide a discovery endpoint.

REFERENCE:


http://www.testkingweb.com/microsoft-70-513.html                                          Page 17 of 198
                                                                                Total Questions: 263

http://msdn.microsoft.com/en-us/library/dd288697.aspx


QUESTION NO: 22(A)
Which of the following terms is a preliminary process for locating Web service descriptions, and also
used to access Web sites?

A. Discovery service
B. Routing service
C. RESTful service
D. Web service

ANSWER: A


QUESTION NO: 23(A)
Which of the following classes allows you to discover the available services?

A. DataAdapter
B. DiscoveryClient
C. DbDataAdapter
D. ServiceOperation

ANSWER: B

EXPLANATION:
The DiscoveryClient class allows you to discover the available services.

Answer option a is incorrect. DataAdapter is used to represent a set of SQL commands and database
connections that are used to fill the DataSet and update the data source section.

Answer option c is incorrect. DbDataAdapter is used to provide strong typing, but inherits most of the
functionality needed to fully implement a DataAdapter.

Answer option d is incorrect. ServiceOperation is used to represent a custom service operation.


What is a WCF Service?
A WCF Service is composed of three parts: a Service class that implements the service to be provided, a
host environment to host the service, and one or more endpoints to which clients will connect. All
communications with the WCF service happens via the endpoints. The endpoints specify a Contract that
defines which methods of the Service class will be accessible via the endpoint; each endpoint may
expose a different set of methods. The endpoints also define a binding that specifies how a client will
communicate with the service and the address where the endpoint is hosted.

In Windows Vista, Windows Server 2008 and Windows 7 (OSs that include IIS 7), Windows Activation
Services can be used to host the WCF service. Otherwise the WCF service can be hosted in IIS, or it can


http://www.testkingweb.com/microsoft-70-513.html                                          Page 18 of 198
                                                                               Total Questions: 263

be self-hosted in any process by using the ServiceHost class, which is provided by WCF. A self-hosted
WCF service might be provided by a console-based application, a Windows Forms application, or a
Windows service.

REFERENCE:
http://msdn.microsoft.com/enus/library/system.servicemodel.discovery.discoveryclient.aspx


QUESTION NO: 24(A)
Which of the following services helps in setting up protocol bridging, handles communication errors, and
dynamically updates routing logic at run time?

A. Web
B. Routing
C. Discovery
D. RIA

ANSWER: B


QUESTION NO: 25(A)
John works as a Developer for Testking Web Inc. He is creating a WCF service based on Framework 4.0.
This WCF service is used to implement a contract with the one-way and request-reply operations. The
WCF service is visible over a TCP transport. The clients who are using this service make use of a router to
communicate with the WCF service. The router is implemented as follows: (Line numbers are included
for reference purpose only)

01 ServiceHost host = new ServiceHost(typeof(RoutingService));
02 host.AddServiceEndpoint(
03 typeof(ISimplexDatagramRouter),
04 new NetTcpBinding(), "net.tcp://localhost/Router"
05 );
06 List <ServiceEndpoint> high = new List <ServiceEndpoint>();
07 high.Add(
08 new ServiceEndpoint(
09 ContractDescription.GetContract(
10 typeof(ISimplexDatagramRouter)
11 ),
12 new NetTcpBinding(),
13 new EndpointAddress("net.tcp://localhost:8080/Logger")
14 )
15 );
16 RoutingConfiguration rc = new RoutingConfiguration();
17 rc.FilterTable.Add(new MatchAllMessageFilter(), high);
18 host.Description.Behaviors.Add(new RoutingBehavior(rc));

The request-reply operations are regularly failing. He needs to ascertain that the router can handle one-


http://www.testkingweb.com/microsoft-70-513.html                                            Page 19 of 198
                                                                               Total Questions: 263

way and request-reply operations regularly. What should he do to accomplish the task?

A. Change line 03 as: typeof(ISimplexSessionRouter.EndProcessMessage)
B. Change line 03 as: typeof(IRequestReplyRouter.BeginProcessRequest)
C. Change line 03 as: typeof(IDisposable.Dispose)
D. Change line 03 as: typeof(IDuplexSessionRouter)

ANSWER: D

EXPLANATION:
IDuplexSessionRouter helps in asynchronous execution of message processing. Changing line number 03
as: typeof(IDuplexSessionRouter) helps in ensuring that the router can handle one-way and request-
reply operations regularly. Although ISimplexDatagramRouter has the same function as that of
IDuplexSessionRouter, it does not ensure that the router can handle one-way and request-reply
operations regularly.

Answer option a is incorrect. It is used for finishing the asynchronous execution of message processing.
It does not ensure that the router can handle one-way and request-reply operations regularly.

Answer option b is incorrect. It is used to initiate asynchronous processing of the message. It does not
ensure that the router can handle one-way and request-reply operations regularly.

Answer option c is incorrect. It is used to perform the application-defined tasks associated with freeing,
releasing, or resetting the unmanaged resources. It does not ensure that the router can handle one-way
and request-reply operations regularly.


What is a rules-driven WCF router?
A rules-driven WCF router is a SOAP router that is a mediator to forward SOAP messages from a client to
an application endpoint based on a set of rules. The router uses the Windows Workflow Foundation
(WF) rules engine to implement the core router functionality that determines where to forward a given
message. The router service uses WCF extensibility to process messages and other activities, such as the
handling of transport patterns (datagram/session, request-reply/duplex).

REFERENCE:
http://msdn.microsoft.com/en-us/library/dd466783.aspx


QUESTION NO: 26(A)
Which of the following is NOT a value of the ProtectionLevel property of the OperationContractAttribute
class?

A. Sign
B. EncryptOnly
C. None
D. EncryptAndSign



http://www.testkingweb.com/microsoft-70-513.html                                           Page 20 of 198
                                                                                  Total Questions: 263

ANSWER: B


QUESTION NO: 27(A)
You are working on a WCF client for a WCF service. You have already created the service proxy. Now,
what must you do next to call the functions of that service?

A. Instantiate a client class that implements the service interface and call its methods.
B. Instantiate a service class and call its methods.
C. Create the service contract then instantiate class that implements the service interface and call the
   methods.
D. Run the ServiceModel Metadata Utility Tool (Svcutil.exe) tool.

ANSWER: A

EXPLANATION:
According to the scenario, you have already created the service proxy. At this point, you should take the
following steps in order to call the functions of the service:
      Create a client class that implements the service interface.

       Instantiate the class and call its methods.

       Use the Svcutil.exe utility tool in order to create and use the client object.

Answer option b is incorrect. You should not instantiate a service class. Instead, you should instantiate a
client class that implements the service interface.

Answer option c is incorrect. You should have created the service contract much earlier when you were
creating the service proxy.

Answer option d is incorrect. You should run the Svcutil.exe utility tool earlier to create the service
proxy.

REFERENCE:
MSDN Article Accessing Services using a WCF client


QUESTION NO: 28(A)
You work as an Application Developer for Testking Web Inc. The company uses Visual Studio .NET
Framework 3.5 as its application development platform. You are working on a client for a WCF service.
You have created the proxy and added to your client project. You have also added and modified the
config file. Now, you want to use the WCF client. Which of the following steps will you take to
accomplish the task?

Each correct answer represents a complete solution. Choose all that apply.




http://www.testkingweb.com/microsoft-70-513.html                                              Page 21 of 198
                                                                                Total Questions: 263

A. Create an endpoint address and a WCF client object.
B. Call the service operations.
C. Call the Open method on the client.
D. Set up the service contract.

ANSWER: A AND B

EXPLANATION:
The steps to use a WCF client are as follows:
    1. Create an endpoint address and a WCF client object.

    2. Call the service operations from within the client object.

    3. Close the client connection once the operation call is complete.

Answer option c is incorrect. You do not call an Open method on the client. Instead, you close the client
once the operation call is completed. Once you have instantiated the client proxy, you simply call its
methods. However, there is a close method if you wish to end all communications with the service.

Answer option d is incorrect. Setting up the service contract must have been completed much earlier for
the process of using the client.

REFERENCE:
MSDN Article How to Use A Windows Communication Foundation Client


QUESTION NO: 29(A)
Which of the following is known as a style of software architecture for distributed hypermedia systems,
such as the World Wide Web?

A. WCF
B. REST
C. WSDL
D. SOAP

ANSWER: B


QUESTION NO: 30(A)
What are the steps defined for designing RESTful Services?

Each correct answer represents a part of the solution. Choose all that apply.


A. The starting is from the traditional RPC-based service, and then redesigning to become a RESTful
   service.
B. Extracting the resources that make up the existing service.


http://www.testkingweb.com/microsoft-70-513.html                                           Page 22 of 198

				
DOCUMENT INFO
Description: Testking Web 70-513 CSHARP Exam - Windows Communication Foundation Development with Microsoft .NET Framework 4 (CSHARP) Questions and Answers with detailed Explanations and Objectives.