You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (Resolved) (JIRA)" <ji...@apache.org> on 2011/10/19 19:29:10 UTC

[jira] [Resolved] (CXF-3812) Problem with DynamicClient failing to invoke service now webservice

     [ https://issues.apache.org/jira/browse/CXF-3812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-3812.
------------------------------

       Resolution: Not A Problem
    Fix Version/s: Invalid
         Assignee: Daniel Kulp


This is more or less working as designed.   If you use the "invoke" method that takes the QName, the parameters that are passed in are assumed to represent the "unwrapped" form of the operation.   Thus, you have a couple options:

1) if you call boi.getUnwrappedOperation(), you can get a new boi that has the parameters in that form.

2) call client.invoke(boi, params) instead.   When you do that, it uses the exact boi that you were using to setup the params.

                
> Problem with DynamicClient failing to invoke service now webservice
> -------------------------------------------------------------------
>
>                 Key: CXF-3812
>                 URL: https://issues.apache.org/jira/browse/CXF-3812
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime, JAXB Databinding, Service Model
>    Affects Versions: 2.4.2
>         Environment: CXF 2.4.2 on Max OS X 10.6.8
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
>            Reporter: Arul Dhesiaseelan
>            Assignee: Daniel Kulp
>             Fix For: Invalid
>
>         Attachments: servicenow-cxf.zip
>
>
> Using CXF dynamic client with CXF service model fails to invoke the ServiceNow public demo web service. It throws a ClassCastException. Attaching a sample project that has test case that shows this problem. Appreciate if you could advice on this behavior. I tried debugging, but it looks like the wrapper helpers (com.service_now.incident.GetRecords_WrapperTypeHelper1) are created on the fly and could not step through.
> Sep 20, 2011 9:47:28 AM org.apache.cxf.jaxb.JAXBUtils logGeneratedClassNames
> INFO: Created classes: com.service_now.incident.DeleteMultiple, com.service_now.incident.DeleteMultipleResponse, com.service_now.incident.DeleteRecord, com.service_now.incident.DeleteRecordResponse, com.service_now.incident.Get, com.service_now.incident.GetKeys, com.service_now.incident.GetKeysResponse, com.service_now.incident.GetRecords, com.service_now.incident.GetRecordsResponse, com.service_now.incident.GetResponse, com.service_now.incident.Insert, com.service_now.incident.InsertResponse, com.service_now.incident.ObjectFactory, com.service_now.incident.Update, com.service_now.incident.UpdateResponse
> com.service_now.incident.GetRecords
> Sep 20, 2011 9:47:29 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
> WARNING: Interceptor for {http://www.service-now.com}ServiceNow_incident#{http://www.service-now.com}getRecords has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: com.service_now.incident.GetRecords cannot be cast to java.lang.Boolean
> 	at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:121)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
> 	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:519)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:449)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:352)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:304)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
> 	at ServiceNowTest.testCXFModelClient(ServiceNowTest.java:59)
> 	at ServiceNowTest.main(ServiceNowTest.java:23)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.ClassCastException: com.service_now.incident.GetRecords cannot be cast to java.lang.Boolean
> 	at com.service_now.incident.GetRecords_WrapperTypeHelper1.createWrapperObject(Unknown Source)
> 	at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105)
> 	... 13 more
> Exception in thread "main" org.apache.cxf.interceptor.Fault: com.service_now.incident.GetRecords cannot be cast to java.lang.Boolean
> 	at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:121)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
> 	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:519)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:449)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:352)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:304)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
> 	at ServiceNowTest.testCXFModelClient(ServiceNowTest.java:59)
> 	at ServiceNowTest.main(ServiceNowTest.java:23)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> Caused by: java.lang.ClassCastException: com.service_now.incident.GetRecords cannot be cast to java.lang.Boolean
> 	at com.service_now.incident.GetRecords_WrapperTypeHelper1.createWrapperObject(Unknown Source)
> 	at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105)
> 	... 13 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira