PrepAway - Latest Free Exam Questions & Answers

Category: 70-503

Exam 70-503: TS: Microsoft .NET Framework 3.5 – Windows Communication Foundation Application Development

Which code segment should you insert at line 04?

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?

Which three actions should you perform next?

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

Which code segment should you use to replace the existing code segment?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
The service contains the following code segment.

[ServiceContract]
public interface IMathSrvc
{
[OperationContract]
void AddNumbers(int num);
[OperationContract]
int Clear();
}

You need to ensure that the service meets the following requirements: The service can call the AddNumbers operation multiple times
The AddNumbers operation must start a session on the initial call. The service must call the Clear operation only if a session exists.
The service must not call other operations after it calls the Clear operation.
Which code segment should you use to replace the existing code segment?

What are two possible ways to achieve this goal?

You are creating a distributed application by using Microsoft .NET Framework 3.5.
The application uses the Windows Communication Foundation model.
You need to ensure that the following requirements are met:
User authentication is performed at the message level.
Data protection is performed at the transport level.
Server authentication is performed at the transport level.
What are two possible ways to achieve this goal?
(Each correct answer presents a complete solution. Choose two.)

Which method implementation should you use?

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?

Whichcode segment should you insert at line 03?

You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
You add the following code segment to the service.

public interface ICalulatorservice
{
[OperationContract]
[FaultContract(typeOf(ArithmeticException))]
double Divide(double number1, double number2);
[OperationContract]
void DisposeCalculator();
}
[ServiceBehavior(IncludeExceptionDetailInFaults=true)]
public class Calculatorservice : ICalulatorservice
{
public double Divide(double number1, double number2)
{
if (number2 == 0) throw new DivideByZeroException();
return (number1 / number2);
}
public void DisposeCalculato()
{
// release resources.
}
}

You add the following code segment to the client application.

01 public double PerformCalculations (double num1, double num2)
02 {
03
04 }

You need to ensure that the DisposeCalculator operation is always called. Which
code segment should you insert at line 03?

Which code segment should you insert at line 10?

You are creating a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
The service will authenticate the client applications by using Personal Information Cards.
You write the following code segment. (Line numbers are included for reference only.)

01 public class CustomServiceAuthorizationManager:
02 ServiceAuthorizationManager{
03 protected override bool CheckAccessCore(OperationContext operationContext)
04 {
05 string action = operationContext.RequestContext.RequestMessage.Headers.Action;
06 if (action == "http://tempuri.org/lEnginefUpdate")
07 {
06 foreach (ClaimSet cs in operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets)
09 {
10
11
12 return false;
13 }
14 return true;
15 }
16 } …
17 bool IsEmailValid(string email)
18 {
19 //e-mail validation is performed here;
20 return true;
21 }

You need to ensure that only those client applications that provide a valid email
address can execute the Update method.
Which code segment should you insert at line 10?

Which code segment should you insert at line 01?

You are creating a Windows Communication Foundation (WCF) client application by using Microsoft .NET Framework 3.5.
The proxy generated for the WCF service results in the following code segment.

[ServiceContract(CallbackContract=typeOf(IStoreCallback))]
public interface IStore
{
[OperationContract(IsOneWay=true)]
void CheckAvailableProducts();
}
public interface IStoreCallback{ }

To implement a callback interface, you create the following class in the client application.
public class StoreCallback: IStoreCallback{ }
The client application receives notifications from the service through the callback interface.
You write the following code segment for the client application to use the generated proxy.
(Line numbers are included for reference only.)

01
02 client.CheckAvailableProducts();

You need to set up duplex communication between the client application and the WCF service.
Which code segment should you insert at line 01?

What are the two possible service implementations that you can use to achieve this goal?

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


Page 10 of 11« First...7891011