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.
The following exhibit illustrates the class definition that currently exists for a Web Service.

WebService(), SoapRpcService()>
public class LicenseService : WebService
<WebMethod(), SoapRpcMethodAttribute()> public numeral ObtainPoints(string licenceNumber)
{
return 0;
}
<WebMethod(),SoapRpcMethodAttribute(string state, string licenseNumber)> void ValidateLicense()
{
}
}

You received instruction to apply the WebServiceBinding attribute to support the Web Service.

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.
The following exhibit illustrates the class definition that currently exists for a Web Service.

WebService(), SoapRpcService()>
public class LicenseService : WebService
<WebMethod(), SoapRpcMethodAttribute()> public numeral ObtainPoints(string licenceNumber)
{
return 0;
}
<WebMethod(),SoapRpcMethodAttribute(string state, string licenseNumber)> void ValidateLicense()
{
}
}

You received instruction to apply the WebServiceBinding attribute to support the Web Service.

What should you do?

A.
A WebServiceBinding attribute should be applied to the class.
Set the Attribute’s Name property to Atlanta.

B.
A WebServiceBinding attribute should be applied to the ObtainPoints method.
Set the Attribute’s Name property to Atlanta.

C.
Two WebServiceBinding attributes should be applied to the class.
Set the Name property of the one attribute to Default and the other to Atlanta.

D.
A WebServiceBinding attribute should be applied to the ValidateLicense method.
Set the attribute’s Name property to Default.
A WebServiceBinding attribute should be applied to the ObtainPoints method.
Set the attribute’s Name property to Atlanta.

Explanation:
It is possible to associate multiple bindings with a Web Service bymeans of multiple WebServiceBinding attributes. Each binding can have a set of operations. Since the SoapRpcMethod attribute that is applied to the ValidateLicence method has its binding set to Default, you should add a corresponding WebServiceBinding attribute to the class. The Binding property of the SoapRpcMethod attribute must map the Name property of the WebServiceBinding attribute. This will indicate that the ValidateLicense Method, is part of a binding named Default. In the same way you should set the Name property of the second WebServiceBinding attribute to Atlanta.
Incorrect answers:
A: Bindings should be defined at the class or Web service level and thus you should not apply a WebServiceBinding attribute to a Web method because a Web method can only indicate the binding to which it is associated.
B: A Webservice class that does not have a WebServiceBinding attribute applied has a default binding. The name of a default binding is usually the name of the Web service appended to the word “Soap”. In this case the default binding is named LicenseServiveSoap. Thus you should not apply a single attribute to the class.
D: You should rather have the WebServiceBinding attribute applied to the class and not to the Web methods.



Leave a Reply 0

Your email address will not be published. Required fields are marked *