Skip to main content
Participant
Apr 9, 2009 5:13 PM UTC
Question

Web Service invocation and Complex Types (java TO's)

I am trying to call a java service from ColdFusion MX 8.0.1 using the following code.

I am the developer of the Java service, not a coldfusion programmer.

<cfscript>
     ws = CreateObject("WebService", "
http://myserver.us/webservices/WebInterface?WSDL");
     vali = CreateObject("Java","vo.myapplication.ContactVO");
     vali.setId(1234);
     vali.setSecondaryID(45855);
     wsResponse = ws.updateContact(vali);
</cfscript>

The call fails with "Object Instantiation Exception - Class not found: vo.myapplication.ContactVO", so i know CF is unable to load my class.

My question is why?

My stubs have been generated into

C:\jrun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\stubs\WS-254617805

and i can see ContactVO in there, in the correct package.

I can make it work if i add the absolute path of the sub directory to

Server Settings > Java and JVM > ColdFusion Class Path

Can anyone tell me why Coldfusion 8.0.1 is not dynamically loading the VO class, so that i can perform a CreateObject?

Thanks in advance!

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

BKBK
Community Expert
Community Expert
Apr 12, 2009 4:24 PM UTC

Another way to dynamically load a custom class like /vo/myapplication/ContactVO.class, besides specifying its path in the classpath, is to place it in the directory {CF_wwwroot}/WEB_INF/classes/. Mind you, I'm on the Coldfusion single-server version, on Windows.

Translate