Whether you're using BlueDragon or CFMX, you may find that an attempt to process even a simple .NET web service (.asmx file) will fail with either of the following:
After considerable research, I finally found that the problem is that the default .net configuration (in the machine.config XML file) is set to not permit such requests!
I find this hard to believe, but all I can report is that after reading the technote at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconfigurationoptionsforaspnetwebservices.asp, I noticed it indicating some commented out elements in the machine.config. On a lark, I removed one of those comments for HttpPost:
<webServices>
<protocols>
<add name="HttpSoap1.2" />
<add name="HttpSoap" />
<add name="HttpPost"/>
....
and sure enough, the CFINVOKE (in both BD and CF) suddenly worked.
For those new to .NET, the machine.config is a global setting control file that affects all web applications on the .NET framework for the machine. It's stored in the location of the .NET framework, which on my machine is C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config.
If you don't want to make this setting in such a global manner, you can take advantage of the .NET framework's ability to allow you to override this sort of setting within the directory where the code is being run (the .asmx file) by creating a (or adding to any existing) web.config file in that same directory. Assuming you have no such file at all, the entries would be:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpSoap1.2" />
<add name="HttpSoap" />
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="HttpPostLocalhost" />
<add name="Documentation" />
</protocols>
</webServices>
</system.web>
</configuration>
If you have one, just enter the <webServices> and child entries under it within any existing <system.Web> entry you may already have.
Note that normally the concept of web.config is that it can inherit any settings set at a higher level config file (such as in the machine.config or in a web.config in an ancestor directory above the current one.) In my testing, this didn't apply. I had to add all the <add name> entries set in machine.config even though they had already been set there.
Also, I found that if the changes were placed in a web.config in a directory that's NOT a virtual directory (or a web app, in .NET parliance), they did NOT have the intended impact. Normally, if you use entries that are not intended to be used in a sub-application directory, the .NET framework complains. It did not, so forewarned is forearmed. (This is on .NET 1.1. Perhaps 2.0 would address this issue better.)
A directory is declared as a "web application" if the directory is set as a virtual directory in IIS. See any .NET resource on creating web apps, or the final chapter of the book, Deploying CFML on the Microsoft .NET Framework, for more information on how to set a virtual directory in IIS.
Finally, again for those new to .NET, note that when you change the machine.config or web.config file, it instantly restarts the .net framework (or in the case of web.config, the web application it controls), so that subsequent requests for the asmx file process with the new setting.
Hi,
Thanks for the post. I had similar issues. when I uploaded my ASP.Net website from vista (IIS7) to win 2003 under IIS6 the webservice stopped working. After add these entries in the web.config the webservice worked for remote call from my pc but still it does not work for localhost calls.