Home > Ask the SOA Experts > Questions & Answers > Invoking a simple SoapExtension in VS.NET
Ask The SOA Expert: Questions & Answers
EMAIL THIS

Invoking a simple SoapExtension in VS.NET

Michèle Leroux Bustamante EXPERT RESPONSE FROM: Michèle Leroux Bustamante

Pose a Question
Other SOA Categories
Meet all SOA Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 25 February 2004
I'm trying to create a simple SoapExtension and can't seem to get the system to invoke the extension. I'm running the Web services class in debug mode from Visual Studio.NET, I have breakpoints set in my Web method, and I am using the web.config to configure the SOAP extension. Can you tell me what I might be missing?

>
Are you testing the Web service from the test page, or invoking it from a Windows Form client? When you run the Web service from VS.NET in debug mode, you are presented with a test page that can invoke methods on your Web service using HTTP POST. This is possible if the Web method receives simple types, as opposed to complex types, as parameters. Regardless, this invocation is not using SOAP protocol it uses HTTP POST protocol.

There is very little use in supporting HTTP POST and HTTP GET protocol for your Web services. First of all, it removes the ability to deal in complex types, secondly, only SOAP protocol can leverage built-in Web services support for the .NET Framework, such as that provided by SOAP extensions. I recommend you disable HTTP GET and POST protocols in the <protocols> section of the web.config (or machine.config) as follows:
<system.web> 
  <webServices> 
    <protocols> 
      <add name="HttpSoap1.2" /> 
      <add name="HttpSoap" /> 
      <remove name="HttpPost"/> 
      <remove name="HttpGet"/> 
      <remove name="HttpPostLocalhost" /> 
      <add name="Documentation" /> 
    </protocols> 
  </webServices> 
</system.web> 
Once you do this, you will not be able to test your Web services through the test form, but who cares? Now, what you want to do is create a Web service proxy from the WSDL contract of your service. Sounds more complicated than it is. Just create add a Web reference to your client application (such as a Windows Forms application) to the service address, for example: http://www.mydomain.com/ServicesDirectory/Service1.asmx which invokes the wsdl.exe utility to generate a C# or VB.NET class that inherits HttpSoapClientProtocol under the hood. This class, you will use to invoke the service using SOAP protocol, which will result in ASP.NET loading applicable SOAP extensions in its path.

It is very important that you turn off HTTP Post and GET protocol so that SOAP protocol is the only supported protocol for your services. Aside from supporting your own SOAP extensions, the WSE 1.0/2.0 plug-in to Visual Studio.NET are deployed as SOAP extensions as well. Without enforce messages to be processed by the Web services extension pipeline, an important step such as checking for digital signatures and decryption using WS-Security standards could be side-stepped...not a good outcome.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Microsoft .NET Web services
Microsoft preps .NET 4.0 - framework improves on REST, MVC, JQuery support
How do I balance throughput requirements and interoperability?
APM software traces transactions across tiers, technologies
How you can learn M Grammar for Oslo modeling
Legacy modernization opens Windows for publisher
Former .NET Web developers ride Ruby and Rails application framework
Microsoft Oslo at PDC: Dial 'M' for modeling language
Yahoo proxy fight looms
New Microsoft site for architects
LAMP coders go hybrid route
Microsoft .NET Web services Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Common Language Infrastructure  (SearchSOA.com)
Visual J#  (SearchSOA.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SOA Governance White Papers - BPM, EDA, IT Governance
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts