You are creating a Windows Communication Foundation service by using Microsoft
.NET Framework 3.5.
You need to programmatically add the following endpoint definition to the service
http://localhost:8000/Examservice/service
Which code segment should you use?
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 (IIsValidCreditCardNumber(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.)
You are creating a Windows Communication Foundation (WCF) service by using
Microsoft .NET Framework 3.5.
You Configure a binding to enable streaming.
You need to ensure that the client application is able to stream large XML files to the WCF service.
Which operation contract should you create?
You are creating a Windows Communication Foundation (WCF) client application by using Microsoft .NET Framework 3.5
The WCF service transfers data to the client applications by using the streaming transfer mode.
You need to create an endpoint that supports the streaming transfer mode.
Which binding should you use?
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.
"1bf47e90fD0acf4c0009cda65eDaadcf1cedd592" is the thumbprint in the client certificate.
What should you do?
You create a Windows Communication Foundation service by using Microsoft .NET
Framework 3.5
You write the following code segment.
[ServiceContract(CallbackContract=typeOf(MyServiceCallback))]
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?
You are creating a Windows Communication Foundation service by using Microsoft
.NET Framework 3.5.
You write the following code segment for the service contract.
(Line numbers are included for reference only.)
01 [ServiceContract]
02
03 public class MyService
04 {
05 ...
06 }
The service uses transactions that time out in a minute.
You need to increase the timeout interval of the transactions to 2 minutes and 30 seconds
Which code segment should you insert at line 02?
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("InterfaceGuidsHere")]
public interface IDocumentStore
{
bool lsDocumentExist(long id);
}
[Guid("ClassGuidsHere")]
public class DocumentStore: servicedComponent, IDocumentStore
{
public bool IsDocumentExist(long id)
{
//This code checks if document exists.
}
}
The application ID of the COM+ application is {AppGuidsHere}.
You need to configure the WCF service to access the COM+ application from the WCF client application.
Which code fragment should you use?
You create a Windows Communication Foundation service by using Microsoft .NET
Framework 3.5.
You want to enable message logging.
You add the following code fragment to the service configuration file. Type="System.Diagnostics.XmlWriterTraceListener" />
You receive an exception.
You need to successfully enable message logging. What should you do?
You are creating a Windows Communication Foundation client application by using
Microsoft .NET Framework 3.5.
You add the following code segment to a service contract.
[ServiceContract]
interface IDocumentService
{
[OperationContract]
int DeleteDocument(int id);
}
The DeleteDocument method in the service contract takes a long time to execute.
The client application stops responding until the method finishes execution.
You write the following code segment to create an instance of a service proxy in
the client application.
(Line numbers are included for reference only.)
01 static void Main()
02 {
03 DocumentServiceClient client= new DocumentServiceClient();
04
05 }
06 static void ProcessDeleteDocument(IAsyncResult result)
07 {
06 ...
09 }
You need to ensure that the service methods are called asynchronously.
What should you do?