Mar 2016 updated: Pass4sure Microsoft 70-503(CSharp) test questions 91-105

70-503(CSharp) Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library! Try it Free Today!

Get it now →

Product Description:
Exam Number/Code: 70-503(CSharp)
Exam name: TS: MS.NET Frmwrk 3.5, Wndws Commun Fndtion App Dev
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Free Certification Real IT 70-503(CSharp) Exam pdf Collection

Question No. 91

You create a stateless, thread-safe service by using Microsoft .NET Framework 3.5. You use the Windows Communication Foundation model to create the service.

Load testing reveals that the service does not scale above 1,000 concurrent users.

You discover that each call to the service instantiates a new service instance. You also discover that these service instances are expensive to create.

You need to ensure that 5,000 concurrent users can access the service.

Which code segment should you use?

A. <ServiceBehavior( _InstanceContextMode:=InstanceContextMode.PerCall,

_ConcurrencyMode:=ConcurrencyMode.Reentrant)> _

B. <ServiceBehavior( _InstanceContextMode:=InstanceContextMode.Single,

_ConcurrencyMode:=ConcurrencyMode.Multiple)> _

C. <ServiceBehavior( _InstanceContextMode:=InstanceContextMode.PerCall,

_ConcurrencyMode:=ConcurrencyMode.Multiple)> _

D. <ServiceBehavior( _InstanceContextMode:=InstanceContextMode.Single,

_ConcurrencyMode:=ConcurrencyMode.Reentrant)> _

Answer: B


Question No. 92

You are creating a client application by using Microsoft .NET Framework 3.5.

The client application will consume a COM+ application by using the Windows Communication Foundation service.

You write the following code segment to implement the COM+ application.

<Guid("InterfaceGuidIsHere")> _

Public Interface IDocumentStore

Function IsDocumentExist(ByVal id As Long) As Boolean

End Interface

<Guid("ClassGuidIsHere")> _

Public Class DocumentStore

Inherits ServicedComponent

Implements IDocumentStore

Public Function IsDocumentExist(ByVal id As Long) _

As Boolean Implements IDocumentStore.IsDocumentExist

'This code checks if document exists

End Function

End Class

The application ID of the COM+ application is {AppGuidIsHere}.

You need to configure the WCF service to access the COM+ application from the WCF client application. Which code fragment should you use?

A. <services> <service name="{AppGuidIsHere},{ClassGuidIsHere}"> <endpoint

binding="wsHttpBinding" contract="IDocumentStore"/> </service></services>

B. <services> <service name="{AppGuidIsHere},{ClassGuidIsHere}"> <endpoint

binding="wsHttpBinding" contract="{InterfaceGuidIsHere}"/> </service></services>

C. <services> <service name="{AppGuidIsHere},{ClassGuidIsHere}"> <endpoint

binding="wsHttpBinding" contract="DocumentStorage.IDocumentStore"/>

</service></services>

D. <services> <service name="{AppGuidIsHere}"> <endpoint binding="wsHttpBinding"

contract="{InterfaceGuidIsHere}"/> </service></services>

Answer: B


Question No. 93

You are creating a distributed application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application. The client application is used in Company A, and the service application is used in Company B. Company A and company B have security token services named STS_A and STS_B respectively. You need to authenticate the client application by using federated security. Which combination of bindings should you use?

A. wsHttpBinding for the client applicationwsFederationHttpBinding for the WCF service

wsFederationHttpBinding for the STS_A servicewsFederationHttpBinding for the STS_B service

B. wsFederationHttpBinding for the client applicationwsFederationHttpBinding for the WCF

servicewsHttpBinding for the STS_A servicewsHttpBinding for the STS_B service

C. wsHttpBinding for the client applicationwsFederationHttpBinding for the WCF

servicewsHttpBinding for the STS_A servicewsFederationHttpBinding for the STS_B service

D. wsHttpBinding for the client applicationwsFederationHttpBinding for the WCF

servicewsFederationHttpBinding for the STS_A servicewsHttpBinding for the STS_B service

Answer: B


Question No. 94

You are creating a client application that will call a Windows Communication Foundation service.

The service was created by using Microsoft .NET Framework 3.5.

You write the following code segment.

[DataContract]

public class CreditCard {

[DataMember]

public string Name { get; set; }

[DataMember]

public string CardNumber {

get {

return cardNumber;

}

set {

if (!IsValidCreditCardNumber(value)) {

throw new ArgumentException("Invalid credit card number");

}

cardNumber = value;

}

}

}

You plan to share the validation logic between the client application and the WCF service.

You need to generate a client-side service proxy that includes the validation logic.

Which four tasks should you perform? (Each correct answer presents part of the solution. Choose four.)

A. Create a Class Library project for the DataContract classes.

B. In the Service project, add a reference to the Class Library project.

C. In the Client project, add a reference to the Class Library project.

D. In the Client project, use the Add Web Reference dialog box to reference the service.

E. In the Client project, use the Add Service Reference dialog box to reference the service.

F. In the Client project, use the Add Reference dialog box to add a project reference to the Service project.

Answer: ABCE


Question No. 95

You create a Windows Communication Foundation (WCF) service by using Microsoft .NET framework 3.5.

You write the following code segment for a service contract.

[ServiceContract]

public interface IOrderManager{

[OperationContract]

void ProcessOrder(int ordered);

}

You need to ensure that the WCF service meets the following requirements:

The ProcessOrder method uses transactions.

The ProcessOrder method commits automatically if no exception occurs.

Which method implementation should you use?

A. [TransactionFlow(TransactionFlowOption.NotAllowed)][OperationBehavior]public void ProcessOrder(int

orderId){}

B. [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=true)]public

Void ProcessOrder(int orderId){}

C. [TransactionFlow(TransactionFlowOption.Allowed)][OperationBehavior(TransactionScopeReq

uired=false, TransactionAutoComplete=true)]public void ProcessOrder(int orderId){}

D. [TransactionFlow(TransactionFlowOption.Allowed)][OperationBehavior(ReleaseInstanceMode

= ReleaseInstanceMode.AfterCall, TransactionScopeRequired=true,

TransactionAutoComplete=false)]public void ProcessOrder(int orderId){}

Answer: B


Microsoft 70-503(VB)

1. You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted on a Web server.

You add the following code fragment to the .svc file.

<% @ServiceHost Factory="ExamServiceFactory" Service="ExamService" %>

You need to create the instances of the services by using the custom ExamServiceFactory class.

Which code segment should you use?

A. Public Class ExamServiceFactory Inherits ServiceHost Protected Overrides Sub ApplyConfiguration()

'Implementation code comes here End SubEnd Class

B. Public Class ExamServiceFactory Inherits ServiceHostBase Protected Overrides Sub ApplyConfiguration() 'Implementation code comes here End SubEnd Class

C. Public Class ExamServiceFactory Inherits ServiceHostFactory Protected Overrides Function CreateServiceHost( _ ByVal serviceType As Type, _ ByVal baseAddresses() As System.Uri)

As ServiceHost 'Implementation code comes here End FunctionEnd Class

D. Public Class ExamServiceFactory Inherits ServiceHost Public Sub New(ByVal serviceType As

Type, _ ByVal ParamArray baseAddresses As Uri()) MyBase.New(serviceType, baseAddresses)

'Implementation code comes here End SubEnd Class

Answer: C


70-503(CSharp) download

Question No. 96

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted in a managed Console application. The service endpoint has an address that is relative to the base address of the service. You need to programmatically add the base address to the service. What should you do?

A. Call a constructor of the ServiceHost class.

B. Call an AddServiceEndpoint method of the ServiceHost class.

C. Create and add a custom endpoint behavior to the service.

D. Create and add a custom operation behavior to the service.

Answer: A


Question No. 97

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted in a managed Console application.

You want to add endpoints to the service.

You need to ensure that all endpoints use the same base address.

Which code fragment should you use?

A. <ServiceContract()> _Public Interface IMortgageServiceEnd InterfacePublic Class

MortgageService Implements IMortgageServiceEnd ClassDim baseAddress As New Uri( _"http:

//localhost:8888/MortgageService")Dim _serviceHost As New ServiceHost(

_GetType(MortgageService), New

Uri() {baseAddress})_serviceHost.AddServiceEndpoint( _GetType(IMortgageService), New

BasicHttpBinding(), "")_serviceHost.Open()

B. <ServiceContract()> _Public Interface IMortgageServiceEnd InterfacePublic Class

MortgageService

Implements IMortgageServiceEnd ClassDim baseAddress As New Uri( _"http:

//localhost:8888/MortgageService")Dim _serviceHost As New ServiceHost(

_GetType(MortgageService), New

Uri() {})_serviceHost.AddServiceEndpoint( _GetType(IMortgageService), _New

BasicHttpBinding(),

baseAddress)_serviceHost.Open()

C. <ServiceContract()> _Public Interface IMortgageServiceEnd InterfacePublic Class

MortgageService

Implements IMortgageServiceEnd ClassDim baseAddress As String = _"http:

//localhost:8888/MortgageService"Dim _serviceHost As New ServiceHost(

_GetType(MortgageService), New

Uri() {})_serviceHost.AddServiceEndpoint( _GetType(IMortgageService), _New

BasicHttpBinding(),

baseAddress)_serviceHost.Open()

D. <ServiceContract( _Namespace:="http: //localhost:8888/MortgageService")> _Public Interface

IMortgageServiceEnd InterfacePublic Class MortgageService Implements

IMortgageServiceEnd ClassDim

_serviceHost As New ServiceHost( _GetType(MortgageService), New Uri()

{})_serviceHost.AddServiceEndpoint( _GetType(IMortgageService), _New BasicHttpBinding(),

"")_serviceHost.Open()

Answer: A


Question No. 98

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You need to expose two different service endpoints that have the same address.

Which configuration setting should you use?

A. <service name="ExamService"> <endpoint address="http:.//localhost:8080/service"

binding="wsHttpBinding" contract="ISimpleExam"/> <endpoint address="http:

//localhost:8080/service" binding="wsHttpBinding" contract="IComplexExam"/></service>

B. <service name="ExamService"> <endpoint address="http: //localhost:8080/service"

binding="wsHttpBinding" contract="ISimpleExam"/> <endpoint address="http:

//localhost:8080/service" binding="wsDualHttpBinding" contract="IComplexExam"/></service>

C. <service name="ExamService"> <host> <baseAddresses> <add baseAddress="http:

//localhost:8080/service"/> </baseAddresses> </host> <endpoint binding="wsHttpBinding"

contract="ISimpleExam"/> <endpoint binding="basicHttpBinding"

contract="IComplexExam"/></service>

D. <service name="ExamService"> <host> <baseAddresses> <add baseAddress="http:

//localhost:8080"/> </baseAddresses> </host> <endpoint address="service"

binding="wsHttpBinding" contract="ISimpleExam"/> <endpoint address="service"

binding="basicHttpBinding" contract="IComplexExam"/></service>

Answer: A


Question No. 99

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.

The service contains the following binding configuration in the configuration file. (Line numbers are included for reference only.)

01 <wsHttpBinding>

02 <binding name="ssl">

03

04 </binding>

05 </wsHttpBinding>

You need to ensure that the following requirements are met:

The service must use transport-level security (SSL via HTTPS).

The service must use message-level security to authenticate client applications by using user name and password.

Which configuration setting should you insert at line 03?

A. <security mode="Message"> <message clientCredentialType="UserName"/></security>

B. <security mode="TransportWithMessageCredential"> <message

clientCredentialType="UserName"/></security>

C. <security mode="Transport"> <transport clientCredentialType="Windows"/> <message

clientCredentialType="UserName"/></security>

D. <security mode="Message" > <transport clientCredentialType="Windows" /> <message

clientCredentialType="UserName" /></security>

Answer: B


Question No. 100

You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.

The WCF service will validate certificates to authorize client applications.

You write the following code segment.

Class Store

Implements IStore

Public Sub RemoveOrder(ByVal ordered As Integer) _

Implements IStore.RemoveOrder

End Sub

End Class

You need to ensure that only those client applications that meet the following criteria can access the RemoveOrder method:

"AdminUser" is the subject in the client certificate.

"1bf47e90f00acf4c0089cda65e0aadcf1cedd592" is the thumbprint in the client certificate.

What should you do?

A. Decorate the RemoveOrder method by using the following attribute.

<PrincipalPermission(SecurityAction.Demand,

_Name:="AdminUser;1bf47e90f00acf4c0089cda65e0aadcf1cedd592")> _ Initialize the

serviceAuthorization

element of the service behavior in the following manner. <serviceAuthorization

principalPermissionMode="Windows"/>

B. Decorate the RemoveOrder method by using the following attribute.

<PrincipalPermission(SecurityAction.Demand,

_Role:="CN=AdminUser,1bf47e90f00acf4c0089cda65e0aadcf1cedd592")> _ Initialize the

serviceAuthorization element of the service behavior in the following manner.

<serviceAuthorization

principalPermissionMode="Windows"/>

C. Decorate the RemoveOrder method by using the following attribute.

<PrincipalPermission(SecurityAction.Demand,

_Role:="AdminUser,1bf47e90f00acf4c0089cda65e0aadcf1cedd592")> _ Initialize the

serviceAuthorization

element of the service behavior in the following manner. <serviceAuthorization

principalPermissionMode="UseAspNetRoles"/>

D. Decorate the RemoveOrder method by using the following attribute.

<PrincipalPermission(SecurityAction.Demand,

_Name:="CN=AdminUser;1bf47e90f00acf4c0089cda65e0aadcf1cedd592")> _ Initialize the

serviceAuthorization element of the service behavior in the following manner.

<serviceAuthorization

principalPermissionMode="UseAspNetRoles"/>

Answer: D


70-503(CSharp) pdf exam

Question No. 101

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You need to host the service in a medium trust environment on a Web server.

Which two bindings should you use? (Each correct answer presents a complete solution. Choose two.)

A. NetMsmqBinding

B. BasicHttpBinding

C. WSDualHttpBinding

D. NetTcpBinding

E. WebHttpBinding

Answer: BE


Question No. 102

You have created a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.

The existing service interface is named IMyService, and contains the following code segment.

<ServiceContract(Name:="SvcOrder", _

Namespace:="http: //contoso.com/services")> _

Public Interface IMyService

<OperationContract()> _

Sub DoSomething()

End Interface

You create a new service named IMyServiceV1 that contains an operation named DoSomethingElse.

You need to ensure that existing client applications are still able to access the IMyService.DoSomething method without modifying client code.

Which code segment should you use?

A. <ServiceContract(Namespace:="http: //contoso.com/services/V1")> _ Public Interface

IMyServiceV1

Inherits IMyService <OperationContract()> _ Sub DoSomethingElse()End Interface

B. <ServiceContract(Name:="SvcOrder")> _ Public Interface IMyServiceV1 Inherits IMyService

<OperationContract()> _ Sub DoSomethingElse()End Interface

C. <ServiceContract(Name:="SvcOrderV1", _ Namespace:="http: //contoso.com/services")> _

Public

Interface IMyServiceV1 Inherits IMyService <OperationContract()> _ Sub

DoSomethingElse()End Interface

D. <ServiceContract(Name:="SvcOrder", _ Namespace:="http: //contoso.com/services")> _

Public Interface

IMyServiceV1 Inherits IMyService <OperationContract()> _ Sub DoSomethingElse()End

Interface

Answer: D


Question No. 103

You are creating a Windows Communication Foundation client application by using Microsoft .NET Framework 3.5.

The client application consumes the Web Services Enhancements (WSE) 3.0 Web service. The Web service uses standard WSE 3.0 to transfer binary data to the client application.

The client application uses the following binding configuration. (Line numbers are included for reference only.)

01 <customBinding>

02 <binding name="custom" >

03

04 <httpTransport maxBufferSize="700000" 04 maxReceivedMessageSize="700000" />

05 </binding>

06 </customBinding>

You need to ensure that the client application receives binary data from the WSE 3.0 Web service.

Which code fragment should you insert at line 03?

A. <binaryMessageEncoding maxReadPoolSize="700000" />

B. <binaryMessageEncoding > <readerQuotas maxBytesPerRead="700000"

/></binaryMessageEncoding>

C. <binaryMessageEncoding > <readerQuotas

maxArrayLength="700000"/></binaryMessageEncoding>

D. <mtomMessageEncoding messageVersion="Soap12WSAddressingAugust2004">

<readerQuotas maxArrayLength="700000"/></mtomMessageEncoding>

Answer: D


Question No. 104

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.

You create the following service contract.

[ServiceContract]

public interface IMyService

{

[OperationContract]

void DoSomething();

}

The service will not use any external resources.

You need to ensure that the calls to the DoSomething operation are thread-safe.

What are the two possible service implementations that you can use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple,

InstanceContextMode=InstanceContextMode.Single)]public class ServiceImpl : IMyService{

public void

DoSomething() { }}

B. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single,

InstanceContextMode=InstanceContextMode.Single)]public class ServiceImpl : IMyService{

public void

DoSomething() { }}

C. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple,

InstanceContextMode=InstanceContextMode.PerSession)]public class ServiceImpl :

IMyService{ public void

DoSomething() { }}

D. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple,

InstanceContextMode=InstanceContextMode.PerCall)]public class ServiceImpl : IMyService{

public void

DoSomething() { }}

Answer: B, D


Question No. 105

You are creating a distributed application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation to create the application.

You plan to perform the following tasks:

Authenticate the client applications by using Microsoft ASP.NET membership provider.

Authorize the client applications by using Microsoft ASP.NET role provider.

You write the following code segment.

<ServiceContract()> _

Public Interface IService

<OperationContract()> _

Sub Remove(ByVal id As Integer)

End Interface

Public Class Service

Implements IService

Public Sub Remove(ByVal id As Integer) _

Implements IService.Remove

End Sub

End Class

You need to ensure that only those client applications that provide credentials belonging to the AdminGroup role can access the Remove method.

What should you do?

A. Add the following attribute to the Remove method of the Service class.

<PrincipalPermission(SecurityAction.Demand, Role:="AdminGroup")> _

B. Add the following attribute to the Remove method of the IService interface.

<PrincipalPermission(SecurityAction.Demand, Role:="AdminGroup")> _

C. Add the following attribute to the Service class.

<PrincipalPermission(SecurityAction.Demand,_

Name:="Remove", Role:="AdminGroup")> _

D. Add the following attribute to the Service class.

<PrincipalPermission(SecurityAction.Demand,_

Name:="IService.Remove", Role:="AdminGroup")> _

Answer: A