WSDL assistance.

17 views
Skip to first unread message

Gavin Baumanis

unread,
Apr 14, 2010, 8:43:06 AM4/14/10
to cfaussie
I am doing some work with Robin Hilliard's Galaxy Service CFC
application and seem to be having an issue.

I get the following error when trying to run a function on a remote
service.

Cannot perform web service invocation send.
The fault returned when invoking the web service operation is:
'' java.lang.IllegalArgumentException: argument type mismatch


If I call the URI directly - then I see the raw XML fine and dandy.
Using :
http://localhost/loginService/loginServiceSampleApp/authUser/AppLoginService.cfc?wsdl

Returns :
This XML file does not appear to have any style information associated
with it. The document tree is shown below.

-
<wsdl:definitions targetNamespace="http://
authUser.loginServiceSampleApp.loginService">
<!--WSDL created by ColdFusion version 9,0,0,251028-->
-
<wsdl:types>
-
<schema targetNamespace="http://xml.apache.org/xml-soap">
<import namespace="http://authUser.loginServiceSampleApp.loginService"/
>
<import namespace="http://rpc.xml.coldfusion"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
-
<complexType name="mapItem"> ......etc......


So I am assuming that the CFC invocation is all fine and dandy;

Here's my code that I am using that causes the error;

<cfset remoteLoginService = createObject("component","/loginService/
loginServiceSampleApp/authUser/AppLoginService").init("http://
localhost/loginService/loginServiceSampleApp/authUser/
AppLoginService.cfc?wsdl")>

Does the password match?<br />
Is the user authenticated?<br />
<cfoutput>
#remoteLoginService.fn_check_user_in_ldap(user = 'test_user', password
= 'test_password')#<br />
</cfoutput>

I do see the text; "Does the Password..."
So it would seem that I have an issue passing parameters to the
function in the manner that I currently am...

If anyone can see anything obivous - I would be most grateful...


Gavin

Gavin Baumanis

unread,
Apr 14, 2010, 7:18:37 PM4/14/10
to cfaussie
Well I decided that I should have a play with Robin's Demo application
and make sure that I could get that working...

And it would seem there might be some other issue other than code
going on here, because I get the exact same error when trying to run
the sample application.

I turned on debug output and when the error is thrown I get the
following message;


Cannot perform web service invocation send.
The fault returned when invoking the web service operation is:
'' java.lang.IllegalArgumentException: argument type mismatch

In the separate debug output window I get a different message though.
/Library/WebServer/Documents/rocketboots/galaxy/trunk/com/rocketboots/
galaxy/Service.cfc(416) @ 09:10:05.780
type Application
message Cannot perform web service invocation send.

I don't know if the messags mean the same and they're ust represented
differently or what the story is...

Can I bother someone to download the download Galaxy and try out the
sample app?
I'm on CF9 - so I'd be interested to see if it is a CF version
specific issue or not.

You can obtain the required code (via SVN) from;
http://svn.rocketboots.com/os/galaxy/

Thanks.

Phil Haeusler

unread,
Apr 14, 2010, 7:28:03 PM4/14/10
to cfau...@googlegroups.com
Gavin
 
If i recall correctly, i'm pretty sure i had to make some changes to Robin's code to make the remote services part work under CF9 when i was playing with it.  There was a difference between CF8 & CF9 around how parameters passed through CFINVOKE are handled.  I'll dig up my code in a bit and get back to you.
 
Phil

 
--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

Gavin Baumanis

unread,
Apr 14, 2010, 7:57:55 PM4/14/10
to cfaussie
HI Phil,
That is great news... thanks..
Great news in the sense that its not me - and that maybe my code is
going to work afterall!

I had a quick look in the Galaxy code - but I have never ever done any
remote service work so it was all a little foreign to me.
Thanks again.

Gavin.

On Apr 15, 9:28 am, "Phil Haeusler" <p...@gtnet.com.au> wrote:
> Gavin
>
> If i recall correctly, i'm pretty sure i had to make some changes to Robin's
> code to make the remote services part work under CF9 when i was playing with
> it.  There was a difference between CF8 & CF9 around how parameters passed
> through CFINVOKE are handled.  I'll dig up my code in a bit and get back to
> you.
>
> Phil
>
> -----Original Message-----
>

> [http://svn.rocketboots.com/os/galaxy/]


>
> Thanks.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "cfaussie" group.
>
> To post to this group, send email to cfau...@googlegroups.com.
>
> To unsubscribe from this group, send email to
> cfaussie+u...@googlegroups.com.
>
> For more options, visit this group athttp://groups.google.com/group/cfaussie?hl=en

> [http://groups.google.com/group/cfaussie?hl=en].

Phil Haeusler

unread,
Apr 14, 2010, 8:55:54 PM4/14/10
to cfau...@googlegroups.com
HI Gavin

I made the following adjustment to Service.cfc to get it working on CF9
for remote calls for methods with no parameters.

You'll need to adjust the cfreturn in the onMissingMethod function of
Service.cfc - Line 416 in latest trunk from

<cfreturn webService.send(missingMethodName, missingMethodArguments)>

to

<cfif not StructCount(missingMethodArguments)>
<cfreturn webService.send(missingMethodName, JavaCast("null", 0))>
<cfelse>
<cfreturn webService.send(missingMethodName, missingMethodArguments)>
</cfif>

I haven't tested to see if this change breaks earlier versions of CF,
but it was done in a made rush to get my laptop up and running for the
last Melb CFUG. If you can try this and it gets it working for you, and
we can ensure that it doesn't break earlier CFs we'll put it to Robin to
get it committed into SVN

Phil


On 15/04/10 9:57 AM, Gavin Baumanis wrote:
> HI Phil,
> That is great news... thanks..
> Great news in the sense that its not me - and that maybe my code is
> going to work afterall!
>
> I had a quick look in the Galaxy code - but I have never ever done any
> remote service work so it was all a little foreign to me.
> Thanks again.
>
> Gavin.
>
> On Apr 15, 9:28 am, "Phil Haeusler"<p...@gtnet.com.au> wrote:
>
>> Gavin
>>
>> If i recall correctly, i'm pretty sure i had to make some changes to Robin's
>> code to make the remote services part work under CF9 when i was playing with

>> it. There was a difference between CF8& CF9 around how parameters passed

Gavin Baumanis

unread,
Apr 14, 2010, 9:37:31 PM4/14/10
to cfaussie
In the interest of quite possibly making an idiot of myself...

Hi Phil,

I have made the changes you provided and I get the same error in the
same place.
Only of course this time it is in the <cfelse> part of the code you
sent me.

It of course works correctly with the Sample app provided by Robin...
so now I am back a step I suppose
with the issue of obviously doing something wrong with my code -
bummer.

Interestingly, I created a method in that CFC that takes no arguments
and returns a simple string.
That works as I would have expected.

Here is the line used to invoke the method on the remote service;


#remoteLoginService.fn_check_user_in_ldap(user = 'test_user', password
= 'test_password')#

Here is the cffunction declaration;
<cffunction
name="fn_authenticate_user"
hint="Function to Authenticate User Against specified LDAP Server :
I return a user object if successful"
access="public"
returntype="Any">

So it would seem that I have an issue with sending arguments to my
method if I use it is a remote service.

Hopefully it is somehting glaringly obvious.. and everyone cvan take
turns slapping my forehead at the CFUG!

Gavin.

Mark Mandel

unread,
Apr 14, 2010, 9:42:38 PM4/14/10
to cfau...@googlegroups.com
Very quick question - when you update the remote code are you
refreshing the wsdl in the administrator?

> http://groups.google.com/group/cfaussie?hl=en.
>
>


--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Hands-on ColdFusion ORM Training @ cf.Objective() 2010
www.ColdFusionOrmTraining.com/

Kai Koenig

unread,
Apr 14, 2010, 10:00:31 PM4/14/10
to cfau...@googlegroups.com
There's also a method in ServiceFactory iirc that you could use to clear it programmatically.

Cheers
Kai


--
Kai Koenig - Ventego Creative Ltd
ph: +64 4 476 6781 - mob: +64 21 928 365 / +61 450 132 117
web: http://www.ventego-creative.co.nz
blog: http://www.bloginblack.de
twitter: http://www.twitter.com/agentK

Hands-on Regular Expression training @ webDU 2010
http://bloginblack.de/agentk/workshop-befriending-regular-expressions/

Hands-on Flash Catalyst and Flex 4 training @ Webinale 2010
http://bloginblack.de/agentk/workshop-rias-with-flash-catalyst-and-flex-4/
--

Phil Haeusler

unread,
Apr 14, 2010, 10:00:44 PM4/14/10
to cfau...@googlegroups.com
This is always a good idea when dealing with Web Services and it has caught me out more than once.  Wouldn't hurt to refresh it - however with Galaxy, all remote calls are proxied through the "send()" remote method rather than to the method directly so there WSDL signature of your service shouldn't change with you are using a standard GalaxySOA implementation. 
 
Phil

Phil Haeusler

unread,
Apr 14, 2010, 10:50:24 PM4/14/10
to cfaussie
Hi Gavin
 
It could well be that this is a completely different issue to the one i came across.
 
My memory is stretched a little bit now, but perhaps try playing around with the returntype of your function.  Maybe start off with a string or struct and get that working and then keep extending it until it breaks.  Happy to investigate more at the CFUG tonight
 
Phil
 
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

Gavin Baumanis

unread,
Apr 14, 2010, 11:20:36 PM4/14/10
to cfaussie
Hi Mark,
I am going to go with "No".

Especially since I have no idea what you're talking about!

Gavin.

On Apr 15, 11:42 am, Mark Mandel <mark.man...@gmail.com> wrote:
> Very quick question - when you update the remote code are you
> refreshing the wsdl in the administrator?
>

> E: mark.man...@gmail.com

Gavin Baumanis

unread,
Apr 14, 2010, 11:30:41 PM4/14/10
to cfaussie
Hi Phil,

Your code change was required none the less to get the sample
application running correctly on CF9.
So that wasn't a waste, at all.

I did a dump;
<cfdump var="#missingMethodName#"><br />
<cfdump var="#missingMethodArguments#"><br />

And can confirm that the methiod name matches the methodf in my CFC
and the missing method arguments also contains a structure of the
arguments that I had passed into the function call.

I created a new function;
<cffunction name="myFunction" access="public" returntype="Numeric" >
<cfargument name="myNumber" default="0" type="numeric">
<cfset fred = arguments.myNumnber +10>
<cfreturn fred>
</cffunction>

and call it like such;


<cfset remoteLoginService = createObject("component","/loginService/
loginServiceSampleApp/authUser/AppLoginService").init("http://
localhost/loginService/loginServiceSampleApp/authUser/
AppLoginService.cfc?wsdl")>

<cfoutput>
#remoteLoginService.myFunction(1)#<br />
<cfoutput>

I wouldn't have thought it got any more simple than that - to be
honest - but it returns the same error message as before.
It would seem to me - that there is some issue with dealing with ANY
kind of attribute that gets sent to the remote method.

Anyhow - unless there is an obvious answer - I will certainly see you
tonight at the CFUG - thanks for the offer to help!

Gavin.

On Apr 15, 12:50 pm, "Phil Haeusler" <p...@gtnet.com.au> wrote:
> Hi Gavin
>
> It could well be that this is a completely different issue to the one i came
> across.
>
> My memory is stretched a little bit now, but perhaps try playing around with
> the returntype of your function.  Maybe start off with a string or struct
> and get that working and then keep extending it until it breaks.  Happy to
> investigate more at the CFUG tonight
>
> Phil
>
> -----Original Message-----
>

> > >> [http://svn.rocketboots.com/os/galaxy/


> [http://svn.rocketboots.com/os/galaxy/]]
>
> > >> Thanks.
>
> > >> --
>
> > >> You received this message because you are subscribed to the Google
> Groups
>
> > >> "cfaussie" group.
>
> > >> To post to this group, send email to cfau...@googlegroups.com.
>
> > >> To unsubscribe from this group, send email to
>
> > >> cfaussie+u...@googlegroups.com.
>
> > >> For more options, visit this group
> athttp://groups.google.com/group/cfaussie?hl=en

> [athttp://groups.google.com/group/cfaussie?hl=en]
>
> > >> [http://groups.google.com/group/cfaussie?hl=en

Gavin Baumanis

unread,
Apr 15, 2010, 9:32:28 AM4/15/10
to cfaussie
Well,

To keep everyone in the loop;
The brains-trust at tonight's Melbourne CFUG all gave me some
assistance with trying to "nut-out" what I had done wrong.
(After the presentation on using the built-in debugger of CFBuilder)

Happy to report that I hadn't done anything wrong - it turns out to be
a CF9 related issue. Well that was the consensus anyway!
Just to prove them right , I have just downloaded / installed CF8 and
my code works fine and dandy.

It seems there is an issue with attribute type casting within the
Galaxy code - where it uses Java classes directly.
Phil has kindly offered to take the baton on this one and work with
Robin to see if it can be resolved for CF9.

It's not all doom and gloom though.... if the CFC is called locally
then Galaxy will correctly create as many instances of the object that
I have asked it to - and all arguments are accepted / actioned as one
would expect too.

So we can continue to re-develop our application using Galaxy SOA as
long all the CFCs are local - which is most likely going to be the
case (at least initially), even when the Remote type casting has ben
nutted out.

Gavin.

Phil Haeusler

unread,
Apr 15, 2010, 8:39:04 PM4/15/10
to cfau...@googlegroups.com
Hi Gavin,

I think we're in luck,

Can you just try changing that Line 416 in Service.cfc from the original

<cfreturn webService.send(missingMethodName, missingMethodArguments)>

to

<cfreturn webService.send(missingMethodName,
Duplicate(missingMethodArguments))>

It seems that there might be something different under the hood of only
the missingMethodArguments argument in the onMissingMethod function in
CF9. Running a Duplicate() on it seems to fix it up into proper struct
which can then successfully be passed to the underlying webservice.

Can you double check and confirm that this fix works for you also.

Thanks
Phil


On 15/04/10 11:32 PM, Gavin Baumanis wrote:
> Well,
>
> To keep everyone in the loop;
> The brains-trust at tonight's Melbourne CFUG all gave me some
> assistance with trying to "nut-out" what I had done wrong.
> (After the presentation on using the built-in debugger of CFBuilder)
>
> Happy to report that I hadn't done anything wrong - it turns out to be
> a CF9 related issue. Well that was the consensus anyway!
> Just to prove them right , I have just downloaded / installed CF8 and
> my code works fine and dandy.
>
> It seems there is an issue with attribute type casting within the
> Galaxy code - where it uses Java classes directly.
> Phil has kindly offered to take the baton on this one and work with
> Robin to see if it can be resolved for CF9.
>
> It's not all doom and gloom though.... if the CFC is called locally
> then Galaxy will correctly create as many instances of the object that
> I have asked it to - and all arguments are accepted / actioned as one
> would expect too.
>
> So we can continue to re-develop our application using Galaxy SOA as
> long all the CFCs are local - which is most likely going to be the
> case (at least initially), even when the Remote type casting has ben
> nutted out.
>
> Gavin.

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

Mark Mandel

unread,
Apr 15, 2010, 9:24:26 PM4/15/10
to cfau...@googlegroups.com
Just a thought - you may want to go with StructCopy() rather than duplicate(). StructCopy() will give you a shall copy of the arguments - leaving object references intact. Duplicate will do a deep copy of everything you are passing through - which is both going to be slow, but also cause some potentially nasty issues down the line.

Mark
--
E: mark....@gmail.com

T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Hands-on ColdFusion ORM Training @ cf.Objective() 2010
www.ColdFusionOrmTraining.com/

Gavin Baumanis

unread,
Apr 15, 2010, 9:45:01 PM4/15/10
to cfaussie
Hi Phil,

Sorry to the bearer of bad news...
but that doesn't work for me.

I get the following error:

Cannot perform web service invocation send.
The fault returned when invoking the web service operation is:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}
Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Deserializing parameter
'sendReturn': could not find deserializer for type {http://
www.vhosts.loginServiceSampleApp.loginservice}loginService

Interestingly - the web addreess is wrong in that string... I'm
guessing it should be http://localhost..... and not http://www.vhosts....?

I tried it by just replacing the copy from trunk with your code from
this morning AND
by using the CFIF block you posted earlier in the thread too - both
throw the same error.

I changed my local method to be access="remote" and called it directly
via URI;
http://localhost/loginservice/loginServiceSampleApp/vhosts/www/loginService.cfc?wsdl&method=fn_authenticate_user

and I get a whole page of text returned.

If I try to pass any attributes to the function in the URI version eg;
http://localhost/loginservice/loginServiceSampleApp/vhosts/www/loginService.cfc?wsdl&method=fn_authenticate_user(user='test_user',password='test_password')

I get the following error... which seems a bit strange - since without
the attributes it seems to return something!
coldfusion.runtime.TemplateProxy$InvalidMethodNameException: The
method fn_authenticate_user(user='test_user',password='test_password')
was not found in component /Library/WebServer/Documents/loginService/
loginServiceSampleApp/vhosts/www/loginService.cfc.

Would it help if I sent you my code?

Gavin

Phil Haeusler

unread,
Apr 15, 2010, 10:11:49 PM4/15/10
to cfau...@googlegroups.com
Gavin

And here i thought i'd struck gold. Feel free to send you code off site
and i'll see if i can reproduce.

The URL you're seeing here is just a string ColdFusion uses under the
hood when it generates the WSDL for your CFC. It's really just a label
and doesn't need to relate to the actual URL being called.

Phil
Reply all
Reply to author
Forward
0 new messages