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 fragment should you use to replace the existing code fragment at line 03?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
The service host is configured in the following manner. (Line numbers are included for reference only.)

01 <system.diagnostics>
02 <sources>
03 <source name="System.ServiceModel" >
04 <listeners>
05 <add name="DefaultListener"/>
06 </listeners>
07 </source>
08 </sources>
09 </system.diagnostics>

You discover that the trace file is empty.
You need to enable tracing.
Which code fragment should you use to replace the existing code fragment at line 03?

Which code segment should you insert at line 06?

You are upgrading an ASMX Web service to a Windows Communication Foundation service application by using .NET Framework 3.5.
You plan to support existing legacy client applications.
You write the following service contract.
[ServiceContract]
interface IPicturesServer
{
[OperationContract]
byte[] GetImage(int id);
}
class PicturesServer: IPicturesServer
{
public byte[] GetImage(int id)
{
return new byte[] { 1, 2, 3 };
}
}
You host the service by using the following code segment. (Line numbers are included for reference only.)
01 using (ServiceHost host=new
02 ServiceHost(typeof(PicturesServer)))
03 ?{
04 BindingElement transport=new
05 HttpTransportBindingElement();
06
07 CustomBinding binding=new CustomBinding(encoding,
08 transport);
09 host.AddServiceEndpoint(typeof(IPicturesServer), binding,
10 address);
11 host.Open();
12 Console.WriteLine("Listening");
13 Console.ReadLine();
14 }
You need to transfer binary data from the server to the client applications.
Which code segment should you insert at line 06?

Which line of code should you insert at line 05?

You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You write the following code segment to implement an operation contract. (Line numbers are included for reference only.)

01 public Message GetMessage()
02 {
03 Message msg=null;
04 MessageVersion ver=null;
05
06 FileStream input=new FileStream("File.xml",
07 FileMode.Open);
08 XmlReader rd=XmlReader.Create(input);
09 msg=Message.CreateMessage(ver, "*", rd);
10 return msg;
11 }

Only the contents of the File.xml file are sent to the client application.
You need to ensure that the SOAP envelope generation is always disabled for messages that are sent to the client application.
Which line of code should you insert at line 05?

Which code segment should you insert at line 03?

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 IMvService
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=value.
Which code segment should you insert at line 03?

Which code segment should you use?

You create a Windows Communication Foundation (WCF) service by using Microsoft .NET Framework 3.5.
The WCF service contains two operations named ProcessSimpleOrder and ProcessComplexOrder.
You need to expose the ProcessSimpleOrder operation to all the client applications.
You also need to expose the ProcessComplexOrder operation only to specific client applications.
Which code segment should you use?


Page 5 of 11« First...34567...10...Last »