2 Replies Latest reply on Jul 2, 2007 4:05 PM by MatWeber

    Problem with SOAP call in CFMX


      we use CFMX 6.1 (Build 6,1,0,hf59825_611) and JVM 1.4.2 on Win2003.

      If we want to call a special web service of a third party tool for newsletter services we get the following error:

      Error Occurred While Processing Request
      []coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 1 semantic error compiling "C:/CFusionMX/stubs/WS-561498559/de/broadmail/api/WebserviceException.java": 24. public java.lang.Object getCause() { <--------> *** Error: The return type of method "java.lang.Object getCause();" does not match the return type of method "java.lang.Throwable getCause();" inherited from type "java/rmi/RemoteException". .

      Otherwise: The Babelfish web service runs perfectly.

      Thank you very much for any help!

      Best regards

      Mathias Weber
      AP Design GmbH

        • 1. Re: Problem with SOAP call in CFMX
          ksmith Level 1
          Hi Mathias,
          CFMX6.1 uses an older version of Axis and seems to be having problems with this webservice. CF8 appears to work directly and I suspect CFMX7 would work also. However, if you can handle a little java it appears this service can work with CFMX6.1.

          First, read the following technote on using WSDL2java. Run wsdl2java against the webservice like in the technote. But update the command using the -W (Nowrap) switch. My command is:
          C:\>c:\j2sdk1.4.2_13\bin\java -cp C:/CFusionMX/lib/webservices.jar
          org.apache.axis.wsdl.WSDL2Java -o d:\rpcservicesWS -vW http://api.broadmail.de/s
          NOTE I added the -W where the technote only used a -v (verbose).

          However, do not immediately compile the stubs as in the last section of the technote. If you do you will see something like:
          C:\>c:\j2sdk1.4.2_13\bin\javac -classpath C:/CFusionMX/lib/webservices.j
          ar D:\rpcservicesWS\de\broadmail\api\*.java
          D:\rpcservicesWS\de\broadmail\api\WebserviceException.java:24: incompatible type
          found : java.lang.Object
          required: java.lang.Throwable
          return cause;
          1 error

          This is much like the original error that is thrown inside CFMX6.1. It indicates that wsdl2java and Axis are creating 'cause' as a class of java.lang.Object, but what is needed is 'cause' to be created as a class of java.lang.Throwable. We can make this update easily enough. Open the file de\broadmail\api\WebserviceException.java in a code editor. We will need to change 4 lines:
          line 13: private java.lang.Object cause;
          change to:
          private java.lang.Throwable cause;

          line 18: java.lang.Object cause,
          change to:
          java.lang.Throwable cause,

          line24: public java.lang.Object getCause() {
          change to
          public java.lang.Throwable getCause() {

          line 28: public void setCause(java.lang.Object cause) {
          change to
          public void setCause(java.lang.Throwable cause) {

          Now save the file and compile just as indicated in the technote.

          If you then go to the output directory you used for the commands you can create a jar file with all the classes included. My command was:
          jar -cvf rpcSession.jar .
          Note the space and period after rpcSession.jar. You can open the file with winzip and you will see all the files and their paths "de\broadmail\api".

          Next include this jar in CFMX's classpath using the java and jvm page in the cfadmin. Restart cfmx appserver as indicated.

          Now in order to use these stubs we need to update the code. I prefer using CreateObject call inside cfscript to cfinvoke. My code is:

          • 2. Re: Problem with SOAP call in CFMX
            MatWeber Level 1
            Hi Ken,

            many thanks, we updated to CF7 and it works.

            Best regards