Copy link to clipboard
Copied
Hi
I've working with webservices for a while now and i know that coldfusion generates java classes for a given wsdl and that these classes are in the <coldfusion_install_dir>\stubs\
Inside the stubs directory there is one folder for each referenced webservice...these folders have names like WS-882657457 or WS2071109075.
What is the relation between the WSDL and these folders? Where can I see the association Webservice - Stub Folder?
Regards.
Copy link to clipboard
Copied
Always found these to be very random. You might be able to use jad, a java decompiler, to gain insight to the url embedded on the class files.
Copy link to clipboard
Copied
It depends, they aren't allways random:
What i needed was something that based on the Webservice name or WSDL gaves me the path to the stub which is possible to do via the following code:
<cfobject action="CREATE" type="JAVA" class="coldfusion.server.ServiceFactory" name="ServiceFactory">
<cfdump var="#ServiceFactory.getXMLRPCService().getWebservice("MyTestWS", ServiceFactory.getXMLRPCService().getMappings()).getClass().getProtectionDomain().getCodeSource().getLocation().toString()#"/>
Anyone knows how can I "convert" this code from cf to java? I need to do this inside a java CFX tag.
Regards.
Copy link to clipboard
Copied
Your example deals with Jave objects already. So why not just write the Java code directly from there? Something like
import coldfusion.server.ServiceFactory;
public class MyClass
{
public String testFunction()
{
try {
//declare ServiceFactory variable
ServiceFactory serviceFactory;
//instantiate ServiceFactory variable
serviceFactory = new ServiceFactory();
//etc., etc., and off you go
}
catch (Throwable ex) {
ex.printStackTrace();
}
return someString;
}
}
Having said that, I have a lot of doubt about the strategy you're following. It is still unclear, to me at least, what you wish to achieve. Why would you want to have a handle on the internal ColdFusion processes between the WSDL and the stubs directory? Since you don't say, it sounds like you're just tinkering in the bowels of the machine. Even if you get it working, it will probably lead to more problems than you expect.
Copy link to clipboard
Copied
Hi
@BKBK i tried that and a "ClassNotFoundException" or something like that.
Anyway I think the first aproach with the Cf code, creating the java object will be enough.
Thanks for the replys.
Regards.