Simon Nash wrote:
Raymond Feng (JIRA) wrote:
[ https://issues.apache.org/jira/browse/TUSCANY-2275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593441#action_12593441 ]
Raymond Feng commented on TUSCANY-2275:
---------------------------------------

Hi,

I debugged the issue and it turned out an interesting case.
1) When the client side pass 'null' for the service.processBean() method, the body of soap message becomes:

<ns1:processBean xmlns1="..."/>

It's the wrapper element with empty children.

2) On the receiving side, the empty data get converted into SimpleBean[0] which is an empty array of SimpleBean.

3) The user code in SimpleServiceImpl.java only tests if the simpleBean==null and it causes an ArrayOutofBoundException. Adding the test of simpleBean.length>0 fixes the problem and the client runs successfuly.

I would resolve it as a user error. I'm not so sure if we should present the data as null or [0]. If you can find any spec covering this corner case, I would be happy to revisit it.

I think the marshalled form should be a wrapper containing a Bean
element with xsi:nil="true", not an empty wrapper.  Would this be
unmarshalled as null instead of an empty array?

To answer my own question, this would be unmarshalled as an array of
length 1 containing a single null.  This seems correct.  Unfortunately
it seems that there is no way to disambiguate this case from the null
array case.  I will do some more investigation into this.

  Simon

  Simon

Thanks,
Raymond

Problem when with Bean[] and null
---------------------------------

                Key: TUSCANY-2275
                URL: https://issues.apache.org/jira/browse/TUSCANY-2275
            Project: Tuscany
         Issue Type: Bug
         Components: Java SCA Data Binding Runtime
   Affects Versions: Java-SCA-1.2
        Environment: Tuscnay 1.2-RC4, WAS
           Reporter: Nishant Joshi
           Assignee: Raymond Feng
            Fix For: Java-SCA-1.2

        Attachments: null problem.zip


I have one service, in which i m passgin Bean[]... If i try to pass null instead then it gives exception ------------------------------------------------------------------------------------------------- Exception in thread "main" org.osoa.sca.ServiceRuntimeException: Target fault type cannot be resolved: null at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:134) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154)
    at $Proxy6.processBean(Unknown Source)
    at com.client.Client.processBean(Client.java:22)
    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:585)
at org.apache.tuscany.sca.implementation.java.invocation.JavaImplementationInvoker.invoke(JavaImplementationInvoker.java:109) at org.apache.tuscany.sca.binding.sca.impl.SCABindingInvoker.invoke(SCABindingInvoker.java:61) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:286) at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JDKInvocationHandler.java:154) at org.apache.tuscany.sca.core.invocation.CglibProxyFactory$CglibMethodInterceptor.intercept(CglibProxyFactory.java:149) at com.client.Client$$EnhancerByCGLIB$$b5aedbbb.processBean(<generated>)
    at com.client.Client.main(Client.java:34)
Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: Array index out of range: 0 at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:97) at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.invoke(DataTransformationInterceptor.java:78)
    ... 15 more
Caused by: org.apache.axis2.AxisFault: Array index out of range: 0
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invokeTarget(Axis2BindingInvoker.java:118) at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Axis2BindingInvoker.java:89)
    ... 16 more
-------------------------------------------------------------------------------------------------
please find the attached sample to reproduce it.
please note that this error was on client side and can be generated using attached sample...
same works for servcie having  bean (not an array of bean)




Reply via email to