Near Shore Consulting Ltd.
View Yves Rochon's profile on LinkedIn
Our Blog
Our Blog
Calling a .net web service from ColdFusion MX 6.1
Location: BlogsNear Shore Blog    
Posted by: admin 11/8/2006 8:54 AM

While developing a solution for a client that involved an ASP.Net 2.0 web service and ColdFusion MX 6.1, we kept receiving the following error when trying to invoke the web service from CF:

Could not perform web service invocation "WebMethodNameHere" because AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envolope/ } VersionMismatch faultSubcode: faultString: Possible SOAP version mismatch: Envelope namespace http://www.w3.org/2002/12/soap-envelope was unexpected.  Expecting http://schemas.xmlsoap.org/soap/envelope/ ...

at org.apache.axis.message.SOAPFaultBuilder.createFault ...

It would appear that ASP.NET web services are configured by default to support SOAP version 1.2 and the ColdFusion MX 6.1 code cannot by default use this protocol.  CF MX 6.1's default is SOAP 1.1.

To solve this problem, we changed the web service's web.config file to explicitly remove support for most protocols by adding the following lines to the system.web section:

<webServices>

   <protocols>

      <remove name="Unknown" />

      <remove name="HttpSoap12" />

      <remove name="HttpGet" />

      <remove name="HttpPost" />

      <remove name="HttpPostLocalhost" />

   </protocols>

</webServices>

You may also consider explicitely removing the Documentation protocol which is responsible for returning a list of exposed methods from your web service.

In our case, the web service was not exposed to the public, and we know the only subscriber was going to be the ColdFusion application, and potentially another .net application, which could easily be configured to use SOAP 1.1.

It may also be possible to configure ColdFusion MX to use SOAP 1.2 by default, we did not explore this option.

Permalink |  Trackback
Blog
Near Shore Consulting  |  Terms Of Use  |  Privacy Statement