From: Tiono on
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
:confused;

From: SafariTECH on
If the value being returned would be a tring by nature, then just check for and
empty string ("")

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



From: Tiono on
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

From: Tiono on
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.jav
a: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(ClientScopePersistenceFilt
er.java:28)
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(MonitoringServletFilte
r.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.jav
a: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(ClientScopePersistenceFilt
er.java:28)
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(MonitoringServletFilte
r.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(MonitoringServletFilte
r.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")) {
[b]nTargetParentFolderId = ed.Get_sord().Get_id();[/b]
}
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?


<cfflush interval="10">
<cfoutput>

<cfset assembly = "C:\ColdFusion8\eloixclient\cELO.dll">
<cfset ix_url = "http://develop:8080/ix-KPK/ix?WSDL">
<cfset userName = "************">
<cfset userPwd = "************">
<cfset clientComputer = "">
<cfset runAsUser = "">
<cfset sMaskNameDicari = "BIRO SDM KEPEGAWAIAN">
<cfset sDoc_Type = "PHOTO YANG BERSANGKUTAN">

<cfscript>
//prosedur login
ix = CreateObject(".NET","cELO.IndexServer.IndexServer",assembly);
ix.Set_Url(ix_url);
ci = CreateObject(".NET","cELO.IndexServer.ClientInfo",assembly);
ci.Set_language("de");
ci.Set_country("DE");
lr = ix.login(ci,userName,userPwd,"","");
session.LoginResult = lr;
ci = lr.Get_clientInfo();

//delete existing BEGIN
/*
*/
FindInfo = CreateObject(".NET","cELO.IndexServer.FindInfo",assembly);

findByIndex = CreateObject(".NET","cELO.IndexServer.FindByIndex",assembly);
findByIndex.Set_maskId(sMaskNameDicari);

objKeys = ArrayNew(1);
objKeys[1] =