Jan 2 2009

HttpGet and Web Services

Category: Location ServicesJoel Ivory Johnson @ 09:08

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> 

Tags: