HttpGet and Web Services

I was creatting a proxy to make use of the OpenCellID web services.  There is no WSDL available for the service so I decided to create a web services solution that had the same interface as the OpenCellID proxy and then use the WSDL that it generated as a starting point for a proper WSDL file (which for me was much less effort then creating the WSDL from nothing).  After creating the initial WSDL I tried to use the WSDL command line tool to create the proxy.  I specified HttpGet protocol and to my surprise I received an empty class file.  I tried again specifying SOAP as the protocol and it worked!  Why the difference in behaviour?  After attempting to solve this for a while without success I decided to post a question on the MSDN forums and quickly received an answer.

As it turns out by default HttpGet (and HttpPost) protocol are disabled for web .Net web services. To enable them you must add them as approved protocols in the web.config file.  After adding the appropriate section things worked like a charm.


        <protocols> 
            <add name="HttpGet"/> 
            <add name="HttpPost"/> 
        </protocols> 

From the BlogEngine Archives

Posts may contain products with affiliate links. When you make purchases using these links, we receive a small commission at no extra cost to you. Thank you for your support.

Mastodon: @j2inet@masto.ai
Instagram: @j2inet
Facebook: @j2inet
YouTube: @j2inet
Telegram: j2inet
Twitter: @j2inet

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.