Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Consuming .Net Webservice with CFInvoke

10 views
Skip to first unread message

Rob_E_Mann

unread,
Feb 23, 2005, 3:22:49 PM2/23/05
to
I am trying to consume a .Net Webservice and am having a problem. The
webservice takes an array of string objects as a parameter, but when I try to
pass an array into the service, I receive the following error:

Could not perform web service invocation "getInfo" because
java.lang.IllegalArgumentException: argument type mismatch
Anyone have any idea how to pass an array of strings into a service?

Code:

<cfset accts = ArrayNew(1)>
<cfset accts[1] = "1111111111111111">
<cfset accts[2] = "2222222222222222">
<cfset accts[3] = "3333333333333333">

<cfinvoke
webservice="http://localhost/WebService/Service1.asmx?WSDL"
method="getInfo"
returnvariable="aArrayOfAccts">
<cfinvokeargument name="accts" value="#accts#"/>
</cfinvoke>

byron1021

unread,
Feb 23, 2005, 11:05:47 PM2/23/05
to
I have a work around for this. Had the same issue trying to pass an array of
strings to .NET. Look for this in your cfmx directory
org/tempuri/arrayOfStrings.class, I forgot how this is generated, or how I
generated it, but if you can't find it I will email it to you.
by...@hostmysite.com Take that and put it in the cfmx class path somewhere.
Then use this code snippet as an example. The java class I guess is a native
array of strings and .NET likes this much better. ary = ArrayNew(1);
ary[1] = '1111111'; ws = createObject ('webservice',
'https://....//asmx?WSDL'); aofs = createObject ('java',
'org.tempuri.ArrayOfString').init(); aofs.setString(ary); ret =
ws.getInfo (accts=aofs);

0 new messages