4 Replies Latest reply on May 22, 2008 3:13 PM by phil@ecu

    HTTP 500 Error when consuming .Net web service from coldfusion

    Tiono Level 1
      Hi,

      I try to consume .NET web services using cf createobject function

      ix = CreateObject(".NET","cELO.IndexServer.IndexServer",assembly);

      Then I call a function that will check if a folder exist or not. If exist this function will return the folder ID, if not then this function return NULL.

      If the folder exist, then I get the folder ID, but if the folder not exist, then I get HTTP 500 Error message.
      I try to put the script in a cftry cfcatch already but still always get HTTP 500 Error message instead of being catch as exception.

      When i test on VB.net the NULL value can be check by using "is nothing" condition. So can someone tell me how to handle .NET web service that return NULL value in coldfusion.

      Thanks and regards,
      Tiono
        • 1. HTTP 500 Error when consuming .Net web service from coldfusion
          SafariTECH Level 1
          If the value being returned would be a string by nature, then just check for an empty string ("")

          I would hazard a guess you are testing in MSIE - turn off the friendly HTTP error messages in MSIE, and turn on Robust error reporting in the CF Admin - you should get a better idea of the actual problem.

          • 2. Re: HTTP 500 Error when consuming .Net web service from coldfusion
            Tiono Level 1
            Value return is not an empty string, I think really nothing is return. In VB.Net this null return can be check using is nothing.

            Someone had give me a hint that the null value might be return as java null, and to handle that we must check the existence of variable.

            This is the example that he gave to me

            <cfset ReturnValue = YOUR_WEB_SERVICE.METHOD() />

            <!--- Check to see if NULL was returned. --->
            <cfif StructKeyExists( VARIABLES, "ReturnValue" )>

            <!--- Valid value was returned. --->

            <cfelse>

            <!--- NULL was returned and deleted the ReturnValue variable from the page scope. --->

            </cfif>

            I'll give it a try first later at my client site.

            Tiono
            • 3. Re: HTTP 500 Error when consuming .Net web service from coldfusion
              Tiono Level 1
              Here is the error message that return by browser :

              500
              ROOT CAUSE:
              java.lang.NoClassDefFoundError: System/Xml/XmlQualifiedName
              at java.lang.Class.getDeclaredConstructors0(Native Method)
              at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
              at java.lang.Class.getConstructor0(Class.java:2699)
              at java.lang.Class.getDeclaredConstructor(Class.java:1985)
              at com.jnbridge.jnbcore.DotNetObjectBase.a(Unknown Source)
              at com.jnbridge.jnbcore.ExceptionFactory.throwException(Unknown Source)
              at cELO.IndexServer.IndexServer.checkoutSord()
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:87)
              at coldfusion.runtime.dotnet.DotNetProxy.invoke(DotNetProxy.java:38)
              at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2260)
              at cftes4c2ecfm1514554849.runPage(D:\Application\Kpk.HRIS\hris\sunfishelo\tes4c.cfm:61)
              at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
              at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
              at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
              at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
              at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
              at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
              at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
              at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
              at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
              at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
              at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
              at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
              at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
              at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
              at coldfusion.CfmServlet.service(CfmServlet.java:175)
              at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
              at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
              at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )
              at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
              at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
              at jrun.servlet.FilterChain.service(FilterChain.java:101)
              at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
              at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
              at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
              at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
              at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
              at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
              at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
              at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
              at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)



              javax.servlet.ServletException: ROOT CAUSE:
              java.lang.NoClassDefFoundError: System/Xml/XmlQualifiedName
              at java.lang.Class.getDeclaredConstructors0(Native Method)
              at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
              at java.lang.Class.getConstructor0(Class.java:2699)
              at java.lang.Class.getDeclaredConstructor(Class.java:1985)
              at com.jnbridge.jnbcore.DotNetObjectBase.a(Unknown Source)
              at com.jnbridge.jnbcore.ExceptionFactory.throwException(Unknown Source)
              at cELO.IndexServer.IndexServer.checkoutSord()
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:87)
              at coldfusion.runtime.dotnet.DotNetProxy.invoke(DotNetProxy.java:38)
              at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2260)
              at cftes4c2ecfm1514554849.runPage(D:\Application\Kpk.HRIS\hris\sunfishelo\tes4c.cfm:61)
              at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
              at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
              at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
              at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
              at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
              at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
              at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
              at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
              at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
              at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
              at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
              at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
              at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
              at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
              at coldfusion.CfmServlet.service(CfmServlet.java:175)
              at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
              at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
              at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 )
              at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
              at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
              at jrun.servlet.FilterChain.service(FilterChain.java:101)
              at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
              at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
              at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
              at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
              at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
              at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
              at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
              at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
              at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

              at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70 )
              at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
              at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
              at jrun.servlet.FilterChain.service(FilterChain.java:101)
              at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
              at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
              at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
              at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
              at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
              at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
              at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
              at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
              at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

              I also attach code of my cfscript that product this error.

              error is cause by

              try {
              ed = ix.checkoutSord(ci, "ARCPATH:" & cekdir, ix.getConstants(ci).Get_EDIT_INFO().Get_mbSord(), ix.getConstants(ci).Get_LOCK().Get_NO());
              if (StructKeyExists(Variables,"ed")) {
              nTargetParentFolderId = ed.Get_sord().Get_id();
              }
              else {
              nTargetParentFolderId = 0;
              }
              }
              catch(Any e) {
              WriteOutput("Error checking folder");
              };

              If folder exist that method will return the folder ID, if folder not exist then I get the error message at top.
              Below is the same code that check folder in VB.Net and no error when no folder exist.

              On Error Resume Next
              sord = ix.checkoutSord(ci, "ARCPATH:" & cekdir, konst.EDIT_INFO.mbSord, konst.LOCK.NO).sord
              On Error GoTo 0
              If sord Is Nothing Then
              foldid = saveFolder(ix, ci, konst, temppathstructure(i), Format(Now, "dd/MM/yyyy"), KWFName, parentid, "")
              If foldid = "-3" Then
              Return "-3"
              Exit Function
              End If
              Else
              foldid = sord.id
              End If

              Hope someone can tell me where did I go wrong here? Is it wrong from the .Net Object, or something from CF?
              • 4. Re: HTTP 500 Error when consuming .Net web service from coldfusion
                phil@ecu
                I'm having the same issue with a 500 error "java.lang.NoClassDefFoundError: System/Xml/XmlQualifiedName"

                It appears that System.Web.Services depends on this class... but, cannot find it when the .NET binary is called through ColdFusion.

                Please, if anyone has a fix for this, let us know. Otherwise, it's down the path of exposing this as a web service and restricting access to it by some whacked-out kluge!

                phil