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 configuration and customization of Web Service applications forms part of your responsibilities at Domain.com.
You are currently busy developing an Extensible Markup Language (XML) Web service. This XML Web service is intended to allow the traffic department to perform driver license verifications. To this end you created the following Web method:

<WebMethod()>
public void VerifyLicence(string licenseNumber)
{}

You need to apply an attribute to the method to specify the parameter style and formatting that is expected from SOAP clients. You should take care that the XML Web Service that you are developing is Web Services Interoperability (WS-1) compliant.

What should you do? (Choose the correct code segment.)

PrepAway - Latest Free Exam Questions & Answers

A.
<SoapDocumentMethod(“urn:gov:DOT”, Use:=SoapBindingUse.Encoded, ParameterStyle:=SoapParameterStyle.Bare)>

B.
<SoapDocumentMethod(“urn:gov:DOT”, Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)>

C.
<SoapRpcMethod(“urn:gov:DOT”,Use:=SoapBindingUse.Encoded)>

D.
<SoapRpcMethod(“urn:gov:DOT”,Use:=SoapBindingUse.Literal)>

Explanation:
To ensure that you comply with the WS-1 standard, you need to make use of document-literal Web methods with wrapped parameter styles. Thus you need to use a SoapDocumentMethod attribute with its Use property set to SoapDocumentUse.Literal and its parameter style property should be set to SoapParameterStyle.Wrapped. Literal in SoapDocumentUse.Literal means that literal formatting should be used. Thus the parameter elements do not need to explicitly specify their types because the elements are included in the definition section of the Web Services Description Language (WSDL) document.
Incorrect answers:
A: The SoapParameterStyle should not be set to Bare as it indicates that parameters can exist as immediate children of the body element in the SOAP request. Furthermore, it does not comply with WS-1 standards.
C: You should not set the Use Property of the SoapDocument method to Encoded because this would indicate that parameter elements must explicitly specify their types.
And it does not comply with WS-1 standards.
D: You should not make use of the SoapRpcMethod attribute since the WS-1 standard does not support the RPC style. And RPC always encapsulates parameters as elements within a single body element.


Leave a Reply