PrepAway - Latest Free Exam Questions & Answers

Category: 70-513 (v.1)

Exam 70-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4 (update June 30th, 2014)

You need to tweak the code in order to make it work

Contract exhibit:
[ServiceContract(CallbackContract typeof(INameService))]
public interface IGreetingSennce
{
[OperationContract]
string GetMessage0,
}
[ServiceContract]
public interface INameService

{
[OperationContract]
string GetName();
}
IGreetingService interface exhibit:
<ServiceContract(CallbackContract typeof(INameService))>
Public Interface IGreetingService
<OperationContract>
Function GetMessage() As String
End Interface
<ServiceContract>
Public Interface INameService
<OperationContract>
Function GetNamne() As String
End Interface
Hosting code exhibit:
Dim host As ServiceHost =
New ServiceHost(GetType(GreetingService))
Dim binding As NetTcpBinding =
New NetTc pBindng(SecurityMode.None)
Host.AddServiceEndpoint(“PassGuideAppIGreetingService”,
binding, net.tcp:localhost = “96374″)
Host Open()
INameService interface exhibit:

class NameService INameService
{
string name;
public NameService(string name)
{
this.name = name;
}
public string GetName()
{
return name;
}}
Class NameService
Implements INameService
Dim name As String
Public Sub NameService(ByV name As String)
Me.reme = name
End Sub
Public Function GetName() As String -Impements INameService. GeNamee
Return name
End Function
End Class
There is a WCF (Windows Communication Foundation) service PassGuideService.
PassGuideService is self-hosted.
The implementations of contracts, the IGreetingService interface, the hosting code, and the
INameService interface are all being displayed in the exhibits.

At the moment the above code fails at line “return String.Format(“Hi there {0}, clientName);”.
You need to tweak the code in order to make it work.
What should you do? (select three)
Use code…

You need to tweak the code in order to make it work

Contract exhibit:
[ServiceContract(CallbackContract typeof(INameService))]
public interface IGreetingSennce
{
[OperationContract]
string GetMessage0,
}
[ServiceContract]
public interface INameService
{
[OperationContract]
string GetName();

}
IGreetingService interface exhibit:
<ServiceContract(CallbackContract typeof(INameService))>
Public Interface IGreetingService
<OperationContract>
Function GetMessage() As String
End Interface
<ServiceContract>
Public Interface INameService
<OperationContract>
Function GetNamne() As String
End Interface
Hosting code exhibit:
Dim host As ServiceHost =
New ServiceHost(GetType(GreetingService))
Dim binding As NetTcpBinding =
New NetTc pBindng(SecurityMode.None)
Host.AddServiceEndpoint(“PassGuideAppIGreetingService”,
binding, net.tcp:localhost = “96374″)
Host Open()
INameService interface exhibit:
class NameService INameService
{
string name;

public NameService(string name)
{
this.name = name;
}
public string GetName()
{
return name;
}}
Class NameService
Implements INameService
Dim name As String
Public Sub NameService(ByV name As String)
Me.reme = name
End Sub
Public Function GetName() As String -Impements INameService. GeNamee
Return name
End Function
End Class
There is a WCF (Windows Communication Foundation) service PassGuideService.
PassGuideService is self-hosted.
The implementations of contracts, the IGreetingService interface, the hosting code, and the
INameService interface are all being displayed in the exhibits.
At the moment the above code fails at line “return String.Format(“Hi there {0}, clientName);”.
You need to tweak the code in order to make it work.
What should you do? (select three)

Use code…

Which interface should be used for PassGuideContract class?

DRAG DROP
There is WCF (Windows Communication Foundation) service PassGuideService.
A data contract PassGuideContract for PassGuideService is being implemented.
PassGuideContract must be forward-compatible.
The round trips must include the information in PassGuideContract.
It should be able to add ew data members to PassGuideContract.
You do have to follow a strict schema validitiy.
Which interface should be used for PassGuideContract class?

Which of the following are NOT the attributes you would set?

You work as an Application Developer for PassGuide.com. The company uses Visual Studio .NET
Framework 3.5 as its application development platform. You have decided to implement
transactions in your WCF service. You wish to implement transactions in your binding settings.
Which of the following are NOT the attributes you would set?
Each correct answer represents a complete solution. Choose two.

How can you ensure that PassGuideOp1 and PassGuideOp2 runs within the same transaction whenever they are calle

DRAG DROP
Service implementation exhibit:

Class PassGuideService
Implements IPassGuideService
Public Sub PassGuideOne(ByVal value As String) —
Implements IPassGuideService. OperationOne

End Sub
Public Sub PassGuideTwo(ByVal value As String) —
Impements IPassGuideService. PassGuideTwo

End Sub
Contract exhibit:
<ServiceContract(SessionMode s SessionMode.Required)>
Publc Interface IPassGuideService
<OperationContract(IsOneWay=True, IsInitiating=True)>
Sub PassGuideOne(ByVal value As String)
<OperationContract(IsOneWay=True, IsInitiating=False)>
Sub PassGuideTwo(ByVal value As String)
End Interface
There is a WCF (Windows Communication Foundation) service PassGuideService.
The contract and implementation of PassGuideService is being displayed in the exhibits.
NetMsmqBinding us used by PassGuideService to listen for messages.
The queue is configured to use transactions for removing and adding messages.
How can you ensure that PassGuideOp1 and PassGuideOp2 runs within the same transaction
whenever they are called within the same session?

How can this be remedied?

DRAG DROP
ContractExhibit:

<ServiceContract>
Public Interface IPassGuideService
<OperationContract>
Sub SaveEmployee(Byval employee As Employee)
End Interface
Binding exhibit:
Dim binding As NetTcpBinding = New NetTcpBinding With (TransactionFlow = True)
Client Call exhibit:
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{
IPassGuideService client = factoryCreateChannel();
client SaveEmployee(employee);
Console.WriteLine(
Transaction.CurrentTransactiominformation
DistributedIdentifier);
tsComplete();
}
SaveEmployee Exhibit:
Public Sub SaveEmployee(ByVal employee As Employee)_
Implements IPassGuideService SaveEmployee
employee.Save()
ConsoleWriteLine(TransactionCurrentTransactionlnformation.
Distributedldentifier)
End Sub

There is a WCF (Windows Communication Foundation) service PassGuideService.
The service and the client has the service contract displayed in the contract exhibit.
The binding of the service and the client is displayed in the binding exhibit.
The client call exhibit displays how the client calls PassGuideService.
The implementation of the PassGuideService SaveEmployee method is displayed in the
SaveEmployee Exhibit.
However, there is a problem. There is distributed identifier mismatch between the client and
PassGuideService.
How can this be remedied?

Which contract should be used?

DRAG DROP
There is a WCF (Windows Communication Foundation) solution for PassGuide.
You need to specify the contract complying to the following requirements:
PassGuideInitialize can always be called before PassGuideTerminate is called.
PassGuideSomething can only be called after PassGuideInitialize has been called.
PassGuideSomething cannot be called after PassGuideTerminate has been called.
PassGuideTerminate can only be called after PassGuideInitialize has been called.
Which contract should be used?

How should bind2 be defined and configured?

DRAG DROP
Hosting Code Exhibit:
Dim host As ServiceHost = New ServiceHost(GetType(CounterService))
Dim bidl As NetTcpBinding =
New NetTcpBinding(SecurityMode.None)
host.AddServiceEndpoint(”PassGuideApp.ICounterService”,
binding, “net.tcp://localhost: 98765”)
host.Open()
Bind2 exhibit:
host.AddServiceEndpoint(‘’PassGuideApp.ICounterService”,
bind2, “http:/!localhost: 98765”)

There is a WCF (Windows Communication Foundation) self-hosted service PassGuideService.
PassGuideService provides a session-based counter.
PassGuideService is exposed over TCP.
The PassGuideService hosting code is being displayed in the exhibit.
PassGuideService must also be exposed over HTTP for external clients.
The session-counter must be able to perform over HTTP at it does over TCP.
How should bind2 be defined and configured?


Page 12 of 15« First...1011121314...Last »