PrepAway - Latest Free Exam Questions & Answers

What should you do?

You work as the Microsoft.NET developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. All servers in the domain run Windows Server 2003.
The following exhibit illustrates the class definition for a data processing Web service:
Exhibit:
[WebService(Namespace-“urn:DataProcessingService”)] Public class DataProcessingService : Webservice
{
[WebMethod(MessageName-“ProcessDataSet”)]
Public void Process(DataSet dataset)
{
}
}
You have been instructed to apply an attribute to the Process method that will result in an immediate return to the caller without invoking a SOAP response. You need to ensure that the attribute that you apply in your solution is Web Services-Interoperability (WS-1) compliant. You thus need to make use of a code segment.
What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Use the [OneWay] code segment.

B.
Use the [WebMethod(BufferResponse=false)] code segment.

C.
Use the [WebMethod(BufferResponse=true)] code segment.

D.
Use the [SoapDocumentMethod(OneWay=true)] code segment.

E.
Use the [SoapRpcMethod(OneWay=true)] code segment.

Explanation:
If you want the Web method to be WS-1 compliant then you should apply the SoapDocumentMethod attribute to the Process method. Setting the attribute of the OneWay property to true indicates an immediate return to the caller without a response when it is invoked.
Incorrect answers:
A: You should not apply the OneWay attribute to the Process method. This attribute is used with .NET Remoting components when a method should immediately return to the caller without a return value.
B: You should not apply a second Web method. Only one WebMethod attribute can be applied to a Web method. Furthermore, the BufferResponse property of the WebMethod attribute does not determine if execution returns to the caller immediately when the associated method is invoked. It determines whether the entire response is placed in memory before it is sent to the caller. However, in this case no responses should be returned.
C: One does not apply a second Web method as suggested in this option.
E: RPC style is not WS-1 compliant.


Leave a Reply