PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

A.
ver = MessageVersion.None

B.
ver = MessageVersion.Default

C.
ver = MessageVersion.Soap11WSAddressing10

D.
ver = OperationContext.Current.IncomingMessageVersion


Leave a Reply