• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Webservice Stubs

Guest
May 10, 2012 May 10, 2012

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.

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 10, 2012 May 10, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 11, 2012 May 11, 2012

Copy link to clipboard

Copied

It depends, they aren't allways random:

  • If you had the webservice reference via the Coldfusion Administrator and specify a name that is different from the WSDL the java stubs will be inside a folder with the webservice name you specify when adding the reference.
  • If you do a cfinvoke them Coldfusion "auto-adds" the reference and the folder name will be "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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2012 May 12, 2012

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 12, 2012 May 12, 2012

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation