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 development and deployment of Extensible Markup Language (XML) Web Services forms part of your responsibilities at Domain.com. You are currently generating a proxy making use of Microsoft Visual Studio 2005 for a Web Services Enhancements (WSE) 3.0-enabled Extensible Markup Language (XML) Web Service in a client application. Unfortunately you did not have the WSE framework installed on your computer at that stage. You thus need to add the custom code to the proxy. At present your application references the following assemblies:
1. System
2. System Configuration
3. System Data System Deployment
4. System Drawing
5. System Web Services
6. System Windows Forms
7. SystemXml
At this stage you install the WSE 3.0 framework on your computer, and in addition you also added the reference to the required WSE 3.0 assemblies to your application. Now you need to make changes to your project to enable you to dynamically apply WSE 3.0 policies to all outgoing SOAP requests. You must ensure that you do not remove any of the custom code that has already been written.
What should you do?
A.
Regenerate the proxy using Visual Studio 2005.
B.
Add a reference to the System.EnterpriseServices assembly.
C.
Modify the proxy class to derive from WebServicesClientProtocol.
D.
Remove the reference to the System.Web.Services assembly.
Explanation:
If you modify the proxy class to derive from WebServicesClientProtocol, then all SOAP requests can adhere to the policies without removing any of the custom code that is already written. This class derived from SoapHttpClientProtocol, which is used to send SOAP messages to a Web service. However, this class also includes a method named SetPolicy which allows for the dynamic application of WSE 3.0 policy to a Web service proxy. Once you apply a policy to a proxy, all subsequent SOAP requests will adhere to that policy.
Incorrect answers:
A: A regeneration of the proxy using Visual Studio 2005 will overwrite the custom code that is written in the proxy.
B: A reference added to the System.EnterpriseServices assembly will not work. This assembly contains types that are used with COM+ and does not provide you with the ability to apply WSE 3.0 policies.
D: A reference removed from the System.Web.Services assembly is not the solution. the WebServicesClientProtocol class derives from SoapHttpClientProtocol, which is defined in the System.Web.Services assembly.