Implementing Web services enhancements (WSE) 3.0

These questions are based on Cert-70-554VB – MSCert: UPGRADE – MCSD Microsoft .NET Skills to MCPD Enterprise Application Developer Using the Microsoft .NET Framework: Part 2 – Section 1 Microsoft Developer Self-Test Software Practice Test.


Objective: Implementing Web services enhancements (WSE) 3.0
SubObjective: Enable WSE in client and server applications


Single Answer, Multiple Choice


As an enterprise application developer, you want to enable WSE 3.0 on an existing Web service. This Web service has never been WSE enabled.


What should you do?



  1. Add a reference to the Microsoft.Web.Services3 assembly and the following to the web.config:
    <configSections>
                    <section name=”microsoft.web.services3″
                      type=”Microsoft.Web.Services3.Configuration.WebServicesConfiguration,
                      Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
                      PublicKeyToken=31bf3856ad364e35″ />
    </configSections>


  2. Add a reference to the Microsoft.Web.Services3 assembly and the following to the web.config:
    <system.web>
      <webServices>
                    <soapServerProtocolFactory               type=”Microsoft.Web.Services3.WseProtocolFactory,
                      Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
                      PublicKeyToken=31bf3856ad364e35″ />
      </webService>
    </system.web>


  3. Add a reference to the Microsoft.Web.Services3 assembly and the following to the web.config:
    <soapExtensionTypes>
                    <add type=”Microsoft.Web.Services3.WebServicesExtension,
                      Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
                      PublicKeyToken=31bf3856ad364e35″ priority=”1″ group=”0″ />
    </soapExtensionTypes>


  4. Add a reference to the Microsoft.Web.Services3 assembly and have the Web service inherit from the WebServicesProtocol class.

Answer:
B. Add a reference to the Microsoft.Web.Services3 assembly and the following to the web.config:
<system.web>
  <webServices>
                <soapServerProtocolFactory               type=”Microsoft.Web.Services3.WseProtocolFactory,
                  Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
                  PublicKeyToken=31bf3856ad364e35″ />
  </webService>
</system.web>


Tutorial:
To enable WSE 3.0 for a Web service, you should add a reference to the Microsoft.Web.Services3 assembly and the following to the web.config:


<system.web>
  <webServices>
                <soapServerProtocolFactory               type=”Microsoft.Web.Services3.WseProtocolFactory,
                  Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
                  PublicKeyToken=31bf3856ad364e35″ />
  </webService>
</system.web>


This configures the WseProtocolFactory class to intercept SOAP messages to process the Web service specifications that WSE 3.0 supports. The WseProtocolFactory class is within the Microsoft.Web.Services3 assembly, so you must also add a reference to that assembly. Also, if you need to configure WSE 3.0 through configuration elements, you should also add the following to the web.config file:


<configSections>
                <section name=”microsoft.web.services3″
                  type=”Microsoft.Web.Services3.Configuration.WebServicesConfiguration,
                  Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral,
                  PublicKeyToken=31bf3856ad364e35″ />
</configSections>


The WSE Settings 3.0 Tool will automatically add this section and the library reference when enabling WSE 3.0. To add the soapServerProtocolFactory element automatically, you can check the Enable WSE 3.0 Soap Protocol Factory checkbox.


You should not add the section element to the configSections section of the web.config because this will enable only WSE 3.0 configuration elements in the web.config. This will not enable the Web service to intercept SOAP messages to process the Web service specifications that WSE 3.0 supports. The soapServerProtocolFactory element should be added to the webService section to enable WSE 3.0 for the Web service.


You should not add the soapExtensionTypes element to the web.config because this is how WSE 2.0 is configured, not WSE 3.0. Unlike WSE 2.0 that was implemented as a SOAP extension, WSE 3.0 uses a custom SOAP protocol rather than the default SOAP protocol normally used in ASP.NET 2.0. The soapServerProtocolFactory element enables a developer to override the default SOAP protocol with a custom implementation. The WseProtocolFactory class provides manages the custom WseProtocol object in WSE 3.0. Although WSE 3.0 still uses a SOAP extension for some functionality, the WseProtocol injects the WseProtocolExtension SOAP extension dynamically at startup. Thus, no soapExentsionsTypes section is necessary when using WSE 3.0 because the soapServerProtocolFactory element and specified WseProtocolFactory class configure all of the required settings at runtime.


You should not have the Web service inherit from the WebServicesProtocol class because there is no such cl

Like what you see? Share it.Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone
cmadmin

ABOUT THE AUTHOR

Posted in Archive|

Comment: