jeffcoughlin.com

Using CF7, SOAP, and soapexample.cfc

Okay, so I'm not sure why this is happening, but a friend of mine was having trouble using Simon Horwith's "Simple SOAP Example".

The error he was getting was the following:

view plain print about
1coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 1 semantic error compiling "C:/CFusionMX7/stubs/WS1832577392/soapexample_pkg/SOAPExampleLocator.java": 10. public class SOAPExampleLocator extends org.apache.axis.client.Service implements soapexample_pkg.SOAPExample { <---------> *** Error: Type soapexample_pkg/SOAPExample was not found. .

I tried the same example code and got the same error. The odd thing was that the error wouldn't happen when using ColdFusion 6.1 (we tested it on CF7.01 Standard running on both IIS and Apache).

After playing with it for a while, I found that if I renamed the CFC file to "anything" other than soapexample.cfc the code ran without fail.

If anyone has any further input on this I'd be happy to hear suggestions.

Note: When renaming the CFC file, you'll need to update a couple variable values at the top of the index.cfm file within the <cfscript/> block.


Update 1: Jared Rypka-Hauer and I spent some time trying to figure this out. We tried updating the Apache AXIS to v1.3, we tried using the latest Cumulative Hotfit for ColdFusion 7, and several other ideas. So far, what we've discovered is that the problem has to do with the displayname attribute set in the <cfcomponent/> tag. For some reason if you leave it to the default setting of "SOAP Exmaple" (or delete the space) the error happens. If, you rename it to anything else it seems to work. Its late, and I'm tired. I'll tackle this another time when I can spare some of it (good luck with that :)).

*** Comments *** (*** Comment Moderation is enabled. Your comment will not appear until approved. ***)
Sean Corfield's Gravatar CF7 added new semantics for the displayname and hint attributes that affect the SOAP XML stream - check the documentation (yes, it gives the impression that the change is only for style="document" but I'm not sure I believe that). Prior to CF7, displayname was pretty useless for cfcomponent (and, in my opinion, for cffunction as well) since the CFC explorer simply showed the original and the display name - and showed the (useful) hint anyway - so I'd pretty much stopped using displayname...
#1 by Sean Corfield | 2/27/06 2:44 PM
Jeff Coughlin's Gravatar Yeah. We thought the same thing last night. So I forced the style to "rpc" (default) which should alleviate any of those errors from happening. Alas, it did not.

Its "possible" there may be a bug somewhere, but our tests were not conclusive enough. Jared has to meet with Tom Jordal soon from Adobe, so he's going to run it by him first to see his thoughts before we submit it as a bug.
#2 by Jeff Coughlin | 2/27/06 3:06 PM
Kai's Gravatar We've got the same issue today and got some sort of solution - well, solutions might be too sophisticated for it...

http://theword.zeroone.co.nz/index.cfm/2006/4/4/co...
#3 by Kai | 4/4/06 1:04 AM
Jeff Coughlin's Gravatar Thanks Kai. One thing I should have mentioned: During testing (preferably on a dev box) you'll likely want to clear your stubs folder (i.e. "<cfroot>/stubs") where ColdFusion (specifically AXIS) stores its web services caching. Thus certain code changes you make (during testing) won't take effect until you clear the related cache.
#4 by Jeff Coughlin | 4/4/06 2:20 AM
Jarek Bochniak's Gravatar Yes... same problem for me...
coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 5 semantic errors compiling "/local/opt/app/coldfusionmx3/stubs/WS-1532004429/DefaultNamespace/TestWsCfcSoapBindingStub.java": 175. if (axisFaultException.detail != null) { <-----------------------> *** Error: No field named "detail" was found in type "org/apache/axis/AxisFault". 176. if (axisFaultException.detail instanceof java.rmi.RemoteException) { <-----------------------> *** Error: No field named "detail" was found in type "org/apache/axis/AxisFault". 177. throw (java.rmi.RemoteException) axisFaultException.detail; <-----------------------> *** Error: No field named "detail" was found in type "org/apache/axis/AxisFault". 179. if (axisFaultException.detail instanceof coldfusion.xml.rpc.CFCInvocationException) { <-----------------------> *** Error: No field named "detail" was found in type "org/apache/axis/AxisFault". 180. ....

On some machines it simply does not work. I was trying stuff wih "displayname" "style", changing file name - it doesn't work..... On different servers it works fine.... I have noticed that it has to do something with java version which server uses. On one server I was able to launch webservices but it was after downgrading to java1.4.2_09 .... but one some servers it still doesn't want to work... I am hopeless..... :( I dont belive that problem lies in Axis version because I have the same versions on several servers and on some it works fine. Any other ideas ?
#5 by Jarek Bochniak | 7/24/06 4:26 AM
Adrian Lynch's Gravatar Thanks. I add the same error on CF8 and changing the display name solved it. I could even change the name back and the error stayed away. Nice one for the answer Jared.
#6 by Adrian Lynch | 10/8/08 1:02 PM
HoaWon's Gravatar I use CF8 and got the same error. Read this article and changed the soapexample.cfc to a totally different name and ran it again, the error went away. Very Strange
#7 by HoaWon | 5/6/10 10:15 AM



BlogCFC 5.9.8.007 by Raymond Camden | RSS | Contact Blog Owner