Coldfusion|Making a call to a Web Service with complex object as input parameter

Steps:

1- Register the webservice in CF admin using any method (whether by manual creation in cf admin or by creating an object)

2- After the wsdl is registered, it will create one folder with a random name, for example ‘WS2002874483‘ under “ColdFusion9/stubs/” directory. This will contain all class files referenced in the wsdl.

3- You need to use this path (“ColdFusion9/stubs/WS2002874483“) to create class path in CF admin.

OR,  you can also copy the generated folder(“ColdFusion9/stubs/WS200287448“) and place it within“ColdFusion9/myStubs/” directory for easily locating it. (Create new folder called ‘myStubs’ under ColdFusion9 if it does not exists). Now, you need to create class path of “ColdFusion9/myStubs” in CF admin.

The classpath creation can be done at:

    CF Administrator -> Server Setting -> Java and JVM -> ColdFusion Class Path -> Full path to ‘myStubs’ or ‘WS2002874483’ folder

4- Restart CF services from windows service manager.

5- Next, use them like any other java object using CreateObject().

So, for example if under WS2002874483 foler you are having com/foo/bar/MyObjectType.class as one of the class that the service uses, and you need creating the object of that, here is the syntax:

  MyObjectType= CreateObject(“java”, “com.foo.bar.MyObjectType”)

Now, you are ready to use ‘MyObjectType’ variable as input to the webservice when the input type is of ‘MyObjectType’ type.

Hope this helps.

150 150 Burnignorance | Where Minds Meet And Sparks Fly!