After reading the comments from @Leigh and a little Google'ing I found the following article about Debugging ColdFusion Webservices. Of particular interest for this question (and what @Leigh was referring too) is the bullet item under number 2 (towards the bottom of the page). I will include that information here in case the referenced page is ever removed.
If you are getting a java.lang.IllegalArgumentException: argument type mismatch
while calling a .Net webservice with ArrayOfInt
or ArrayOfString
as the argument type, then most probably you are not defining the datatypes correctly. The ArrayOfInt
and ArrayOfString
will lead you to believe that .Net is expecting an Array. But remember ColdFusion arrays are not the same as .Net arrays. If you look at the wsdl carefully, you will notice that the ArrayOfInt
is defined as a complexType name.
<s:complexType name="ArrayOfInt">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="int" type="s:int" />
</s:sequence>
</s:complexType>
And complex types in CF are mapped to Structures. Further, you will notice that this complex type has an element with name="int". Now when java looks at the wsdl and creates the stub class files, its renaming this element to "_int". My guess is that its doing this because "int" is a reserved word in Java and also a native data type. So what this means is to successfully call the .Net webservice, you need:
<cfset objGroupIds = StructNew()>
<cfset objGroupIds._int = ListToArray("627303")>
<cfset callResult = myObj.getUser(objGroupIds)>