Which two actions should you perform?

You are developing an ASP.NET Web service. The following code segment implements the service.
(Line numbers are included for reference only.)
01 <WebServiceBinding(
ConformsTo:=WsiProfiles.BasicProfile1_1)>
02 Public Class ProductService
03 Inherits System.Web.Services.WebService
04
05 <WebMethod()>
06 Public Function GetProduct(
07 ByVal name As String) As Product

08
09 End Function
10
11 <WebMethod()>
12 Public Function GetProduct(
13 ByVal id As Integer) As Product
14
15 End Function
16
17 End Class
You need to ensure that both GetProduct methods can be called from a Web client. Which two
actions should you perform? (Each correct answer presents part of the solution. Choose two.)

You are developing an ASP.NET Web service. The following code segment implements the service.
(Line numbers are included for reference only.)
01 <WebServiceBinding(
ConformsTo:=WsiProfiles.BasicProfile1_1)>
02 Public Class ProductService
03 Inherits System.Web.Services.WebService
04
05 <WebMethod()>
06 Public Function GetProduct(
07 ByVal name As String) As Product

08
09 End Function
10
11 <WebMethod()>
12 Public Function GetProduct(
13 ByVal id As Integer) As Product
14
15 End Function
16
17 End Class
You need to ensure that both GetProduct methods can be called from a Web client. Which two
actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A.
Remove line 01.

B.
Add the Shared modifier on lines 06 and 12.

C.
Add the following attribute before line 11. <SoapDocumentMethod(Action:=”GetProductById”)>

D.
Modify the attribute on line 11 as follows. <WebMethod(MessageName:=”GetProductById”)>

Explanation:
WebServiceBindingAttribute Class
(http://msdn.microsoft.com/en-us/library/system.web.services.webservicebindingattribute.aspx)



Leave a Reply 0

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