开发者

Can't consume .NET web service in ColdFusion MX

We are trying to consume an ASP.NET web service from our CF box and are running into odd issues.

<cfinvoke webservice="http://myserver.mine.com/myservice.asmx?WSDL" method="ImportData" returnvariable="ImportDataCompleted">
<cfinvokeargument name="importJobName" value="job1">
<cfinvokeargument name="force" value="false">

If we run this from a version 9 box, it will work just fine, however, when I run on MX, I get the following error:

Could not perform web service invocation "ImportData" because AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}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/. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}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/. faultActor: faultNode: faultDetail: 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(SOAPFaultBuilder.java:260) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169) 开发者_Python百科at org.ap...

I have cleared the web services in the administrator, and they do repopulate, but still the error. Any ideas?!


It looks like this is happening because the version of MX you're using is running SOAP 1.1 and ColdFusion 9 is running SOAP 1.2. (Note the text in your error: Possible SOAP version mismatch.)

I'm not familiar with SOAP, but it looks like there are some other differences between the two that you might want to read about. There is a related question that suggests that earlier versions of CF, at least, do not (or did not) support 1.2.


If you are using ColdFusion MX 6.1, you will not be able to consume web services using the cfinvoke tag. The engineers at Adobe/Macromedia didn't include that functionality until CFMX 7.

You will be required to use Java stubs. See this link.

Once you have created the stubs you need to compile them using Java 1.4 (you can use ColdFusion's internal jdk to do so). Then, create a jar file and deploy it to you instance of ColdFusion, normally ./runtime/lib/. Restart ColdFusion and create an object using CFObject. Then call the web service's methods using the Java object your just created.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜