Skip to main content


Showing posts from February, 2010

Casting a Vector in Coldfusion

How to invoke a java based webservice in coldfusion and pass a vector argument to a method of that webservice?

As Vector in Java could be an array of any type, lets consider here this type is an object. So to pass an argument of vector to a java webservice first create an Array and then an object as below:

<cfset aVector=arrayNew(1)>
<cfset vector=structNew()>
<cfset vector.arg1="Edit">
<cfset vector.arg2="blabla">
<cfset aVector[1]=vector>

Now an array of an object is ready to be passed to the webservice:

<cfset ws.setContent("#aVector#")>

Simply this is the way to cast a vector in coldfusion, if you have any question don't hesitate to ask.