15 tips on How to 70-503(CSharp) Test Like a Badass

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. 16

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

You write the following code segment. (Line numbers are included for reference only.)

01 public interface IMyService

02 {

03

04 string ProcessString(string name);

05 }

You create a host for the WCF service. You also create a service endpoint at

http://localhost:8080/service.

You add an instance of the HttpTransferEndPointBehavior class to the host.

You need to ensure that the ProcessString method can be invoked from a Web browser by using the URL http://localhost:8080/service/process?name=valueWhich code segment should you insert at line 03?

A. [OperationContract(Name="process", Action="Get")]

B. [OperationContract(Name="process", Action="Post")]

C. [OperationContract][WebGet(UriTemplate = "process?name={name}")]

D. [OperationContract][WebInvoke(UriTemplate = "process?name={name}")]

Answer: C


Question No. 17

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be exposed for consumption. You need to ensure that the service supports interoperability with the broadest possible number of Web Service toolkits. The service must also support transport-level security. Which configuration setting should you use?

A. <endpoint address="" binding="basicHttpBinding" contract="IContract"></endpoint>

B. <endpoint address="" binding="wsHttpBinding" contract="IContract"></endpoint>

C. <endpoint address="" binding="wsDualHttpBinding" contract="IContract"></endpoint>

D. <endpoint address="" binding="wsFederationHttpBinding" contract="IContract"></endpoint>

Answer: A


Question No. 18

You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5. You need to host the WCF service on the IIS Web server. First, you create a new folder for your application files. Next, you use the IIS management tool to create a Web application in the new folder. Which three actions should you perform next? (Each correct answer presents part of the solution. Choose three.)

A. Create a web.config file that contains the appropriate configuration code. Place this file in the application folder.

B. Create a web.config file that contains the appropriate configuration code. Place this file in the same folder as your service contract code.

C. Create a service file that has the .svc extension containing the @service directive information for the service. Move this file to the application folder.

D. Create a service file that has the .svc extension containing the @servicehost directive information for the service. Move this file to the application folder.

E. Create a vti_bin sub-folder within the application folder for your code files. Place the code file that defines and implements the service contract in this folder.

F. Create an App_Code sub-folder within the application folder for your code files. Place the code file that defines and implements the service contract in this folder.

Answer: ADF


Question No. 19

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. The service will be hosted in a Windows Service environment. You need to create a Windows Service class that instantiates a service host. Which code segment should you use?

A. Public Class WindowsExamService Inherits ServiceController Private _serviceHost As

ServiceHost

Public Shadows Sub Start() serviceHost = New ServiceHost(GetType(ExamService))

_serviceHost.Open()

End SubEnd Class

B. Public Class WindowsExamService Inherits ServiceHostBase Private _serviceHost As

ServiceHost

Public Shadows Sub Open() _serviceHost = New ServiceHost(GetType(ExamService))

_serviceHost.Open() End SubEnd Class

C. Public Class WindowsExamService Inherits ServiceBase Private _serviceHost As ServiceHost

Protected

Overrides Sub OnStart(ByVal args() As String) _serviceHost = New

ServiceHost(GetType(ExamService))

_serviceHost.Open() End SubEnd Class

D. Public Class WindowsExamService Inherits ServiceHost Private _serviceHost As ServiceHost

Public

Shadows Sub Open() _serviceHost = New ServiceHost(GetType(ExamService))

_serviceHost.Open() End

SubEnd Class

Answer: C


Question No. 20

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

Client applications that run on different platforms access the WCF service. These applications transmit confidential data to the WCF service.

You write the following binding configuration

....

<binding name="TransportSecurity" >

<security mode="Transport" />

</binding>

...

You need to configure the service for optimum interoperability and optimum security.

Which code fragment should you use?

A. <service name="AdventureWorks.Travel.ReservationService"> <endpoint address=""

binding="wsHttpBinding" contract="AdventureWorks.Travel.IReservationService"/> <host>

<baseAddresses> <add baseAddress="http: //localhost:80/Service/"/> </baseAddresses>

</host></service>

B. <service name="AdventureWorks.Travel.ReservationService"> <endpoint address=""

binding="basicHttpBinding" contract="AdventureWorks.Travel.IReservationService"/> <host>

<baseAddresses> <add baseAddress="http: //localhost:80/Service/"/> </baseAddresses>

</host></service>

C. <service name="AdventureWorks.Travel.ReservationService"> <endpoint address=""

binding="basicHttpBinding" bindingConfiguration="TransportSecurity"

contract="AdventureWorks.Travel.IReservationService"/> <host> <baseAddresses> <add

baseAddress="https: //localhost:443/Service/"/> </baseAddresses> </host></service>

D. <service name="AdventureWorks.Travel.ReservationService"> <endpoint address=""

binding="wsHttpBinding" bindingConfiguration="TransportSecurity"

contract="AdventureWorks.Travel.IReservationService"/> <host> <baseAddresses> <add

baseAddress="https: //localhost:443/Service/"/> </baseAddresses> </host></service>

Answer: C


Question No. 21

You are creating a client application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application.

The client application uses a Personal Information Card to provide authentication information to the WCF server.

You write the following code fragment. (Line numbers are included for reference only.)

01 <wsFederationHttpBinding>

02 <binding name="requireCardSpace">

03 <security mode="Message">

04 <message >

05

06 </message>

07 </security>

08 </binding>

09 </wsFederationHttpBinding>

You need to ensure that one of the claims in the Personal Information Card contains an e-mail address. Which code fragment should you insert at line 05?

A. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress" isOptional="false"/></claimTypeRequirements><issuer

address="http:

//schemas.xmlsoap.org/ws/2005/05/identity/issuer/personal"/>

B. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress"/></claimTypeRequirements><issuer address="http:

//schemas.xmlsoap.org/ws/2005/05/identity/issuer/personal"/>

C. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress"/></claimTypeRequirements><issuer address="http:

//schemas.xmlsoap.org/ws/2005/05/identity/issuer/managed"/>

D. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress" isOptional="false"/></claimTypeRequirements><issuer

address="http:

//schemas.xmlsoap.org/ws/2005/05/identity/issuer/self"/>

Answer: D


Question No. 22

You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment.

[ServiceContract(CallbackContract=typeof(IMyServiceCallback))]

public interface IMyService

{

[OperationContract]

void MyMethod();

}

[ServiceContract]

public interface IMyServiceCallback

{

[OperationContract]

void CallbackMethod();

}

The implementation of the MyMethod operation must call back the CallbackMethod operation.

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

The CallbackMethod operation is able to call the service.

The service instance is thread-safe.

Which service implementation should you use?

A. [ServiceBehavior]public class ServiceImpl : IMyService{ public void MyMethod() {

IMyServiceCallback cb=

OperationContext.Current.GetCallbackChannel<IMyServiceCallback>();

cb.CallbackMethod(); }}

B. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single)]public class ServiceImpl :

IMyService{

public void MyMethod() { IMyServiceCallback cb=

OperationContext.Current.GetCallbackChannel<IMyServiceCallback>(); cb.CallbackMethod();

}}

C. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)]public class ServiceImpl :

IMyService{

public void MyMethod() { IMyServiceCallback cb=

OperationContext.Current.GetCallbackChannel<IMyServiceCallback>(); cb.CallbackMethod();

}}

D. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)]public class ServiceImpl :

IMyService{ public void MyMethod() { IMyServiceCallback cb=

OperationContext.Current.GetCallbackChannel<IMyServiceCallback>(); cb.CallbackMethod();

}}

Answer: D


Question No. 23

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

You write the following code segment. (Line numbers are included for reference only.)

01 [ServiceContract(Namespace="http://uri.contoso.com")]

02 public interface IMyService

03 {

04 [OperationContract]

05 string ProcessDetails(string s);

06 [OperationContract(Action="UpdateStatus")]

07 void UpdateStatus();

08

09 }

If the existing operation contract is unable to process a request made to the service, a generic operation contract must attempt to process the request.

You need to create the generic operation contract.

Which code segment should you insert at line 08?

A. [OperationContract(Action="*")]void ProcessOthers(Message msg);

B. [OperationContract(Action="*")]void ProcessOthers();

C. [OperationContract(Action="Default")]void ProcessOthers(Message msg);

D. [OperationContract(Action="Default")]void ProcessOthers();

Answer: A


Question No. 24

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]

void Remove(int id);

}

public class Service : IService

{

public void Remove(int id)

{

}

}

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


Question No. 25

You are creating a client application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application.

The client application uses a Personal Information Card to provide authentication information to the WCF server.

You write the following code fragment. (Line numbers are included for reference only.)

01 <wsFederationHttpBinding>

02 <binding name="requireCardSpace">

03 <security mode="Message">

04 <message >

05

06 </message>

07 </security>

08 </binding>

09 </wsFederationHttpBinding>

You need to ensure that one of the claims in the Personal Information Card contains an e-mail address.

Which code fragment should you insert at line 05?

A. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress" isOptional="false"/></claimTypeRequirements><issuer

address="http://schemas.xmlsoap.org/ws/2005/05/identity/issuer/personal"/>

B. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress"/></claimTypeRequirements><issuer address="http:

//schemas.xmlsoap.org/ws/2005/05/identity/issuer/personal"/>

C. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress"/></claimTypeRequirements><issuer address="http:

//schemas.xmlsoap.org/ws/2005/05/identity/issuer/managed"/>

D. <claimTypeRequirements> <add claimType="http: //schemas.xmlsoap.org/ws/2005/05/

identity/claims/emailaddress" isOptional="false"/></claimTypeRequirements><issuer

address="http://schemas.xmlsoap.org/ws/2005/05/identity/issuer/self"/>

Answer: D


Question No. 26

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: IStore

{

public void RemoveOrder(int ordered)

{

}

}

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


Question No. 27

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]

void DoSomething();

}

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 : IMyService{ [OperationContract] void DoSomethingElse();}

B. [ServiceContract(Name="SvcOrder")]public interface IMyServiceV1 : IMyService{ [OperationContract] void DoSomethingElse();}

C. [ServiceContract(Name="SvcOrderV1", Namespace="http: //contoso.com/services")]public Interface IMyServiceV1 : IMyService{ [OperationContract] void DoSomethingElse();}

D. [ServiceContract(Name="SvcOrder", Namespace="http: //contoso.com/services")]public interface IMyServiceV1 : IMyService{ [OperationContract] void DoSomethingElse();}

Answer: D


Question No. 28

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

You write the following code segment for the service implementation. (Line numbers are included for reference only.)

01 public void PutMessage(Message msg)

02 {

03 string value=null;

04

05 }

You need to retrieve the content from the received message body and store it in the variable named value.

Which code segment should you insert at line 04?

A. value=msg.GetBody<string>();

B. string ns=msg.Headers.GetHeader<string>(0);value=msg.GetBodyAttribute("Body", ns);

C. XmlReader reader=msg.GetBody<XmlReader>();value=reader.ReadOuterXml();

D. XmlReader reader=msg.GetReaderAtBodyContents();value=reader.ReadOuterXml();

Answer: D


Question No. 29

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

{

bool IsDocumentExist(long id);

}

[Guid("ClassGuidIsHere")]

public class DocumentStore: ServicedComponent, IDocumentStore

{

public bool IsDocumentExist(long id)

{

//This code checks if document exists.

}

}

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. 30

You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You set up tracing for the service. The tracing fails because of an error in the service configuration. You need to identify the cause of the error. What should you do?

A. Examine the system event log.

B. Examine the security event log.

C. Examine the application event log.

D. Set the enableLogKnownPii attribute to true in the machine.config file.

Answer: C