Lucee 5.3.3.62 Error (java.lang.NoSuchMethodException)
Message puydf1hvwoi8.loginAPI.setUserid(java.lang.Long)
Stacktrace The Error Occurred in
C:\www\gunter\CF_XTM_Test1.cfm: line 3
Gunter, I’m not so sure your conclusions are correct (though I understand how you would come to them). But better, I have a tool to propose that should help you (which we can’t use, since that wsdl url is not open to us publicly).
First, as for the error I don’t think it’s saying that setuserid does not exist, but rather just that a call to it with the given argument types used did not find a method with that type signature.
Second, you say it wants to use long, but instead I think it’s that Lucee is turning that 99 into a long, and THAT is what the web service is saying it does not support. I could be wrong.
Third, I appreciate that you tried using text instead, and then it said it wanted a number. There are other number types, and maybe it’s wanting it cast in a certain one.
Here is where a tool would be helpful, to tell you what the web service offers for methods and their arguments and types.
And while some editors (including CFBuilder and the old Eclipse CF extensions, and even some generic non-CFML editors) offer such web service browsing tools, there are also some online browsing tools, such as:
And even though WE can’t browse the WSDL over the web using such a tool, perhaps YOU can from your internal development machine, or at least from a browser on the server where the CFML is running.
Let us know what you may find.
Along those same lines, some may wonder if that method itself would really expect a username/password or rather whether you should be putting it on the createobject call itself (which supports a username/password), But as you note, the method seems to implicitly call a setter on the userid, so it seems it does expect (or at least support one). Again, a soap browsing tool will tell you for sure, and what it expects.
Then we can focus on how best to pass it what it expects, if you may not find the answer on your own with that new clarity.
Hello,
Thanks for your reply and suggestions.
I tried to find earlier today a similar workaround/solution and found a post of Ben Nadel suggesting to make SOAP requests with raw XML and manual HTTP posts.
I used a desktop tool called SoapUI 5.5.0 to test the SOAP webservices, and it gave me the SOAP envelope for the request. This I used for making the calls myself, and it seems to work.
This is what I came up with so far:
Now I need to find a way to parse this output.
Tried this: <cfset soapResponse = xmlParse( httpResponse.fileContent ) />
But trows an error. The output is not really XML, sort of …
As for switching to passing in XML, I’d warn against complicating things that way. It may not be necessary. The reason I suggested you use a tool was to see WHAT datatype was expected for that userid field.
But as for your error with parsing the filecontent, you will help yourself by just doing a cfdump of it, to see if it is even XML. It may be, but it may not. Or it may not be in a form that xmlparse knows to process (which requires an opening <?xml> directive, etc.
Ah, I am seeing that you did provide the output of that variable, though you are showing the debug output instead, right? Or if that is a dump, then notice that it’s not JUST XML. It opens and closes with --. XMLParse won’t know what to do with that.
More to the point, the XML is that from the web service, in SOAP format. Here is where I said that switching from using the CFML web service feature to pure cfhttp communications would be more work. See if Ben’s resource (or others) may tell you how best to process that result. You can’t just xmlparse it.
But really, I’d propose you instead see my last comment and try to get things working as you originally hoped. The whole point of CFML’s web service handling is to ease the burden of web service processing, making it just about CFML (as the CFML engine does the dirty work) versus you having to focus on the http communications and pure xml processing.
A lot of those articles on the web talking about “doing it yourself” with cfhttp are either a) for some strange need that regular CFML processing can’t handle, or b) from a time when earlier CFML engines had more trouble with various aspects of some web services (or versions) that were being called. Sometimes that extra work is just not warranted, as “powerful” as it may seem.
But how can I cast the parameter “userId” to an “int”, or force Lucee to handle it as an “int”? XTM_getXTMInfo = ws.getXTMInfo({password="*****", userId=99, client="*******"},{});
Gunter, I appreciate that you used FR to find the indication of the call wanting an int, and it’s great that Mark shared the javacast, but since you’re still having problems applying those discoveries, would you please use one of the tools (whether SOAPUI or the soapclient svc) to let the WEB SERVICE tell you FOR SURE what datatype it expects for userid?
FWIW, I had been holding off suggesting javacast simply because the FIRST focus is to find WHAT datatype it expects. You seem to be dancing all around this simple suggestion I have made from the very first reply yesterday. I don’t understand why.
Was it perhaps challenging for you to find what the tools were reporting as the datatype? Again, since we can’t access the web service remotely, we can’t tell “for you”. Someone may propose that if you share the WSDL, we could look directly at it or point our own wsdl browsing tool at that. But note that often the wsdl will include references to still other wsdl which is pulled in dynamically, so we’d again not have access to that if it’s also not publicly accessible.
Bottom line: does your view of the wsdl or use of either tool show you WHAT datatype is expected for setuserid? Since that seems to be a setter that’s called implicitly, it may not appear in the definition of that getXTMInfo method you’re actually calling, but there should be definition SOMEWHERE in the wsdl that would define it.
I’m sorry, you’re right. But I’m not avoiding it, I simply couldn’t find that info in the SOAPUI application.
I downloaded the WSDL file (XTMCustomerMTOMWebService.xml (266.6 KB) ), and this is specified:
In case it is helpful … I had a similar problem and this was the code I used to manually make a request to the problematic webservice. I apologize that it is not commented very well but just to break it down:
‣ calls a remote webservice : svcUserAdmin Web Service (working url)
‣ notice the function is set to allow the manual entry of the variables (ex: …example.domain.com…) including AuthUserName, AuthPassword and DomainName
‣ notice the method called is GetUsers
‣ notice that after examining the webservice you can see that the result node name is: UserInfo … it would not take much for you to find your node name and required params to pass into your modified version of this function
Converts the data type of a ColdFusion variable to a specified Java type to pass as an argument to Java or .NET object. Use only for scalar, string, and array arguments.
Lucee:
Converts the data type of a CFML variable to pass as an argument to an overloaded method of a Java object.
Use only for scalar and string arguments.
So, meaning it is usable only for Java objects (so, not for “webservice” objects), and only for scalar and string arguments.
So JavaCast() holds no possible solution here anyway, correct?