java.lang.IllegalArgumentException: array element type mismatch

I am able to login to a wsdl, but I get stuck went I want to execute a method.  I get java.lang.IllegalArgumentException: array element type mismatch.
I am following a piece of PHP code that works fine, but when I convert it to cold fusion code it stops working.

Here is the PHP code snippet:

$docxfer = new SoapClient($wsdl);
id = "1234";
$ticket = $docxfer->doLogin($usr,$pwd);
$Customer = $docxfer->getCustomer($id, $ticket);

ColdFusion Code:
<cfscript>
      docxfer = createObject("webservice", #wsdl#);
        id = "1234";
      ticket = docxfer.doLogin(#usr#,#pwd#);
      Customer = docxfer.getCustomer(#id#,#ticket#);
</cfscript>
CF_PROAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

silvera21Commented:
Well first of all you do not need the '#' signs inside the function calls. Why don't you dump out all of the contents of each of those variables and make sure the data type matches what is supposed to be passed in.

You could also try removing one line of code at a time until you get the error to go away, then add the other lines back to make sure...and you will know which function call is causing the error.

Another thing you can try is running the functions with hard coded values. What way you know if it is a problem with the variables or the values themselves.
0
CF_PROAuthor Commented:
I got rid of the # signs, still the same problem.

I dumped the ticket variable

Class Name        com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket
Methods       
Method       Return Type
equals(java.lang.Object)       boolean
getAuthorizedActions()       java.lang.String[]
getDeserializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName)       org.apache.axis.encoding.Deserializer
getOrganization()       java.lang.String
getPassword()       java.lang.String
getPermittedActions()       com.xxxx.www._package.com_syscorp_foundation_services_security_vos.PermittedActions[]
getSerializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName)       org.apache.axis.encoding.Serializer
getTypeDesc()       org.apache.axis.description.TypeDesc
getUser()       java.lang.String
getUserdesc()       java.lang.String
getUsername()       java.lang.String
hashCode()       int
isAuthenticated()       boolean
isMonitoring()       boolean
isTracing()       boolean
setAuthenticated(boolean)       void
setAuthorizedActions(java.lang.String[])       void
setMonitoring(boolean)       void
setOrganization(java.lang.String)       void
setPassword(java.lang.String)       void
setPermittedActions(com.xxxx.www._package.com_syscorp_foundation_services_security_vos.PermittedActions[])       void
setTracing(boolean)       void
setUser(java.lang.String)       void
setUserdesc(java.lang.String)       void
setUsername(java.lang.String)       void

I did remove the
Customer = docxfer.getCustomer(#id#,#ticket#);
line of code and then there is no problem, so I know it got passed the DoLogin method.

I am not able to run the
Customer = docxfer.getCustomer(#id#,#ticket#);
with a hardcoded value because I am not sure how to reconstruct the ticket array.
0
_agx_Commented:
What are the argument types of the web service method, and what types of variables are you passing into the web service?
0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

_agx_Commented:
Didn't see the last post before responding.  

Can you dump the web service object so we can see the getCustomer method?
0
silvera21Commented:
What are the dimensions and datatypes of the ticket array? My first guess is that there is a mismatch between the type of array expected by the service and the type you are sending in.

If you put the ticket value in the isArray() function, do you get yes?

 It is odd because the ticket array is what is returned by the previous function. You may make sure it doesn't return null if there are no results.
0
CF_PROAuthor Commented:
Here is a dump of the web service object:

Class Name        com.xxxx.www.wsdl.Services.IExtServicesStub
Methods       
Method       Return Type
doAELogin(java.lang.String, java.lang.String)       com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket
doCustomerAlertDelete(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerAlertInsert(com.xxxx.www._package.com_syscorp_authorizationengine_customer.CustomerAlertVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerAlertUpdate(com.xxxx.www._package.com_syscorp_authorizationengine_customer.CustomerAlertVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerDelete(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerDocDelete(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerDocInsert(com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerDocUpdate(com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerDocUpdateWithImage(com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerInsert(com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerUpdate(com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doCustomerNoteInsert(com.xxxx.www._package.com_syscorp_feepay_customer.CustomerNoteVO, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       void
doLogin(java.lang.String, java.lang.String)       com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket
getCustomerAlertByCardnum(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_customer.CustomerAlertVO
getCustomerAlertTypeList(com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_dbtools_utils.LabelValueBean[]
getCustomerIdentification(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_customer.CustomerIdentVO
getCustomerIdentificationListByCardNum(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_customer.CustomerIdentVO[]
getCustomerIdentificationListByCustomer(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_customer.CustomerIdentVO[]
getCustomer(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerVO
getCustomerDoc(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO
getCustomer(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO[]
getCustomerDocListByCustomer(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO[]
getCustomerDocWithImage(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerDocVO
getCustomerList(java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_authorizationengine_.CustomerVO[]
getCustomerNoteListSearch(java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_feepay_customer.CustomerNoteVO[]
getIdentificationTypeList(com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_dbtools_utils.LabelValueBean[]
getPhoneCountryList(com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket)       com.xxxx.www._package.com_syscorp_dbtools_utils.LabelValueExtBean[]
Fields       
Field       Value
java.lang.String ENDPOINT_ADDRESS_PROPERTY       javax.xml.rpc.service.endpoint.address
java.lang.String PASSWORD_PROPERTY       javax.xml.rpc.security.auth.password
java.lang.String SESSION_MAINTAIN_PROPERTY       javax.xml.rpc.session.maintain
java.lang.String USERNAME_PROPERTY       javax.xml.rpc.security.auth.username
0
CF_PROAuthor Commented:
Ok I used
IsArray: #isArray(ticket)#
and I got a NO result.

0
silvera21Commented:
maybe the id is registering as an integer instead of a string? you could try '#id#' (with the quotes)
0
silvera21Commented:
I think the ticket is an object, not an array, but from the webservice definition it looks like that is expected.
0
_agx_Commented:
> IsArray: #isArray(ticket)#
> and I got a NO result.

Is the function actually expecting an array? It doesn't look like it from the signature:
         getCustomer( java.lang.String,   .... SecurityTicket)

Can we see the whole error message? The error message may be misleading.
0
CF_PROAuthor Commented:
Whole Error:

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

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
 faultSubcode:
 faultString: java.io.IOException: java.lang.IllegalArgumentException: array element type mismatch
 faultActor:
 faultNode:
 faultDetail:
      {}stacktrace:java.rmi.UnmarshalException: java.io.IOException: java.lang.IllegalArgumentException: array element type mismatch
      at xxxx.soap.wsdl.SOAPOperation.getArgs(Unknown Source)
      at xxxx.soap.java.handlers.service.SOAPToServiceHandler.invoke(Unknown Source)
      at xxxx.soap.java.handlers.service.SOAPToServiceHandler.handle(Unknown Source)
      at xxxx.soap.security.handlers.SecurityHandler.handle(Unknown Source)
      at xxxx.soap.handlers.interceptor.SOAPInterceptorHandler.handle(Unknown Source)
      at xxxx.soap.routing.RoutingHandler.handle(Unknown Source)
      at xxxx.soap.handlers.logging.SOAPLoggingHandler.handle(Unknown Source)
      at xxxx.soap.handlers.setup.SetupHandler.handle(Unknown Source)
      at xxxx.soap.http.HTTPToSOAP.service(Unknown Source)
      at... ''

0
silvera21Commented:
I think it is expecting an object - which from the dump is what the ticket appears to be. so I wonder if the issue is with the id. Maybe pass it in with JavaCast?

JavaCast("string", id)
0
_agx_Commented:
> JavaCast("string", id)

Yes, I already suggested that above.
0
_agx_Commented:
> Yes, I already suggested that above.

My bad.  I didn't.

@CF_PRO - what CF version are you using?
0
CF_PROAuthor Commented:
Ok I put in:

      Customer = docxfer.getCustomer(JavaCast("string", id),ticket);


Same error
0
CF_PROAuthor Commented:
Version:         8,0,1,195765
0
_agx_Commented:
From what I can see, it looks like you're doing everything wrong.  Without access to the service, I'm not sure what else to suggest here (beyond really low level debugging). Unfortunately, CF web services aren't always the easiest tool to work with.  They're fine with simple stuff.  But I've had a lot of problems consuming services with complex types. Also with certain types of .NET web services.  Sometimes I have just had to resort to using cfhttp and soap. Because I never could get past the Axis errors.  Sorry, I couldn't be of more help.


0
_agx_Commented:
> From what I can see, it looks like you're doing everything wrong.

  Correction: doing everything  RIGHT !  
0
silvera21Commented:
maybe try javacasting the ticket??

JavaCast("com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket", ticket)

I have never tried this so...maybe.... :)
0
CF_PROAuthor Commented:
you mean

JavaCast(id, "com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket")

?
0
silvera21Commented:
All I can think of is that CF isn't converting the datatypes, the the datatype is supported a little differently in cf that it is the whatever language the webservice is written in.  Have you tried using a different id? Just in case? Or accessing a different function?
0
silvera21Commented:
no, just the ticket, or both (but would need two javacast function calls)
0
_agx_Commented:
> maybe try javacasting the ticket??
> I have never tried this so...maybe.... :)

No, according to the docs that's not allowed for javacast.

0
CF_PROAuthor Commented:
ok so:

Customer = docxfer.getCustomer(JavaCast("string", id),JavaCast("com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket", ticket));

correct?
0
silvera21Commented:
Yeah...but I am guessing it didn't work or you wouldn't be asking :(

Hmm, that is a tough one.
0
_agx_Commented:
It's not allowed. But even if it were,  it shouldn't be needed as you're already passing in the correct object. I suspect this may be one of these buggy Axis/web service issues.  Really tough to debug.
0
silvera21Commented:
Is there documentation for this webservice? Does it say what you should be passing in (datatypes and such)?

I am not sure why you are converting from PHP, but you could try accessing the .net or java APIs through CF to run it. I couldn't tell you how to do that though.
0
silvera21Commented:
agx: yeah I bet you are right.

You could try contacting the webservice developer (if you can) and see if they have run into that problem with their service. they may be able to better assist you.

That is what I have done in the past to troubleshoot weird webservice issues!
0
CF_PROAuthor Commented:
I cannot get soap to work on php using https wsdl

Ok I get the following error when I try javacasting both

JavaCast type com.xxxx.www._package.com_syscorp_foundation_services_security_vos.SecurityTicket must be one of the following types: byte, char, short, int, long, float, double, boolean, string, bigdecimal, their corresponding array representation (eg : int[]) or null.
0
silvera21Commented:
yeah, as agx said, it is not an allowed datatype for that function
0
CF_PROAuthor Commented:
I can give you guys the wsdl info that pertains to the method I am trying to use.  Let me know if that will help?
0
silvera21Commented:
Sure, why not? :)
0
CF_PROAuthor Commented:

<wsdl:message name="getCustomer18In">
<wsdl:part name="id" type="xsd:string"/>
<wsdl:part name="Ticket" type="n10:SecurityTicket"/>
</wsdl:message>

<wsdl:message name="getCustomer18Out">
<wsdl:part name="Result" type="n12:ArrayOfCustomerDocVO"/>
</wsdl:message>

<wsdl:operation name="getCustomer" parameterOrder="sCardNum Ticket">
<wsdl:input name="getCustomer18In" message="tns:getCustomer18In"/>
<wsdl:output name="getCustomer18Out" message="tns:getCustomer18Out"/>
</wsdl:operation>

<wsdl:operation name="getCustomer">
<soap:operation soapAction="getCustomer" style="rpc"/>
<wsdl:input name="getCustomer18In">
<soap:body use="encoded" namespace="x" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>

<wsdl:output name="getCustomer18Out">
<soap:body use="encoded" namespace="x" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
0
_agx_Commented:
Can you post the info for the SecurityTicket type?
ie <wsdl:part name="Ticket" type="n10:SecurityTicket"/>
0
CF_PROAuthor Commented:
<xsd:complexType name="SecurityTicket">
-
<xsd:all>
<xsd:element name="authenticated" type="xsd:boolean"/>
<xsd:element name="authorizedActions" nillable="true" type="xsd:ArrayOfstring"/>
<xsd:element name="username" nillable="true" type="xsd:string"/>
<xsd:element name="password" nillable="true" type="xsd:string"/>
<xsd:element name="organization" nillable="true" type="xsd:string"/>
<xsd:element name="user" nillable="true" type="xsd:string"/>
<xsd:element name="userdesc" nillable="true" type="xsd:string"/>
<xsd:element name="tracing" type="xsd:boolean"/>
<xsd:element name="monitoring" type="xsd:boolean"/>
<xsd:element name="permittedActions" nillable="true" type="n10:ArrayOfPermittedActions"/>
</xsd:all>
0
_agx_Commented:
If you dump each of those ticket values, what do you see? Warning, some of them maybe null ie Undefined

<cfdump var="#ticket.authenticated#">
<cfdump var="#ticket.authorizedActions#">
etc....

0
CF_PROAuthor Commented:
Authenticated:
YES
AuthorizedActions:
array [empty]
username
*****
password
******
organization
******
user
******
userdesc
empty
tracing
NO
monitoring
NO
permittedActions
array
1       
object of com.xxxx.www._package.com_syscorp_foundation_services_security_vos.PermittedActions
Class Name       com.xxxx.www._package.com_syscorp_foundation_services_security_vos.PermittedActions
Methods       
Method       Return Type
equals(java.lang.Object)       boolean
getAuthorizedActions()       java.lang.String[]
getDeserializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName)       org.apache.axis.encoding.Deserializer
getPermission()       java.lang.String
getSerializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName)       org.apache.axis.encoding.Serializer
getSubject()       java.lang.String
getTypeDesc()       org.apache.axis.description.TypeDesc
hashCode()       int
setAuthorizedActions(java.lang.String[])       void
setPermission(java.lang.String)       void
setSubject(java.lang.String)       void
2       
object of com.xxxx.www._package.com_syscorp_foundation_services_security_vos.PermittedActions
Class Name       com.xxxx.www._package.com_syscorp_foundation_services_security_vos.PermittedActions
Methods       
Method       Return Type
equals(java.lang.Object)       boolean
getAuthorizedActions()       java.lang.String[]
getDeserializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName)       org.apache.axis.encoding.Deserializer
getPermission()       java.lang.String
getSerializer(java.lang.String, java.lang.Class, javax.xml.namespace.QName)       org.apache.axis.encoding.Serializer
getSubject()       java.lang.String
getTypeDesc()       org.apache.axis.description.TypeDesc
hashCode()       int
setAuthorizedActions(java.lang.String[])       void
setPermission(java.lang.String)       void
setSubject(java.lang.String)       void


Interesting that the permitted actions is empty, I am having my 3rd party looking into this.
I have to let you know that PHP code works in the test environment, and so does the Cold Fusion code.
However this code I am working with now, is in the live environment that uses https, and php failed to work in that environment (I could not even login)
So now I am trying out my coldfusion code, so this permitted actions array could be the stumbling block.
0
silvera21Commented:
Well, if the same code works in the test environment it is definitely not a problem with the code, it is the environment. You should dump this info out on dev and see if permitted actions is also empty. Otherwise I would work with your provider to resolve any issues with HTTPS transmission.
0
_agx_Commented:
> the live environment that uses https, and php failed to work in that environment
> so this permitted actions array could be the stumbling block.

Oooh... you didn't mention any of that earlier.  If I'd known you'd gotten it to work at all CF, I would have gone in different direction ;-) But yeah, it sounds like either the https and/or one of the Ticket arrays may be the problem.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CF_PROAuthor Commented:
Sorry I did not mention that before.
I don't think https is the problem, otherwise I would not even been able to get authenticated in coldfusion.
I think it has to do with the permitted actions being empty.  Do you think that logic makes sense?

0
silvera21Commented:
Is it empty on dev? If not, then that is most likely it.
0
_agx_Commented:
Yes, it makes sense. What other differences are there between prod and dev?  Also, you can test on prod using http instead of https?  If it works with http, then the issue's related to https. If it doesn't, then it's something else about the prod environment.
0
CF_PROAuthor Commented:
they don't have http active on the live environment.  The admin is checking my permissions now.
0
CF_PROAuthor Commented:
Does the error I am getting make sense if my permission were not set right?
0
_agx_Commented:
> Does the error I am getting make sense if my permission were not set right?

   There's no way for us to know, because the error just says "array...", not which array or where the
   error is occurring.  But it's a good logical guess since some of the ticket properties are arrays.

   (Did you find out if the permissions array is empty on dev too?)
   
0
_agx_Commented:
.. unfortunately web service error message ie Axis are usually terribly uninformative.
0
CF_PROAuthor Commented:
I am waiting on the admin and developer to get back to me.  I am praying this is the problem.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.