[ 
https://issues.apache.org/jira/browse/TUSCANY-1683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577379#action_12577379
 ] 

ant elder commented on TUSCANY-1683:
------------------------------------

The above code looks like a good fix to me, would you be able to submit a patch 
for this in diff format? You can do that with the SVN diff command, for 
example, in the folder where you've changed XML2JavaBeanTransformer.java do 
"svn diff > tuscany-1683.diff" and that will create a file named 
tuscany-1683.diff which we can apply automatically. Let me know if you have any 
trouble doing that.

> AXIS data binding can not process array Type response
> -----------------------------------------------------
>
>                 Key: TUSCANY-1683
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1683
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Axis Binding Extension
>    Affects Versions: Java-SCA-0.99
>         Environment: windows jboss axis2
>            Reporter: wenchu
>             Fix For: Java-SCA-Next
>
>
> I want to publish a service, it interface describe below:
> public interface UDBService{public User[] getUsersByCompanyId(String 
> companyId);}
> I use  java2wsdl tools of axis2 to generate wsdl, it describe below:
> <xs:element name="getUsersByCompanyIdResponse">
> <xs:complexType>
>    <xs:sequence>
>       <xs:element maxOccurs="unbounded" minOccurs="0" name="return" 
> nillable="true" type="xsd:User"/>
>    </xs:sequence>
> </xs:complexType>
> </xs:element>
> but i find 
> org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLTransformer can run 
> correct  and it check array type,change it correct. when client receive the 
> xml, and org.apache.tuscany.sca.databinding.javabeans.XML2JavaBeanTransformer 
> transform error.
> the reason as below:
> 1.not to check it's type.
> 2.to create object use " L javaInstance = javaType.newInstance()  " it will 
> throw exception ,because jdk not support use this method to create array type 
> instance. It is line 82.
> i  check the javaType and do anther process,modify code as below:
>               // mod by wenchu.cenwc array type process
>               if (javaType.isArray())
>               {
>                       L javaInstance = 
> (L)Array.newInstance(Class.forName(javaType.getComponentType().getName())
>                                                       , childElements.size());
>                       
>                       for (int count = 0; count < childElements.size(); 
> ++count) 
>                       {
>                               Object node = 
> createJavaObject(childElements.get(count)
>                                               
> ,Class.forName(javaType.getComponentType().getName()),context);
>                               
>                               Array.set(javaInstance, count, node);
>                       }
>                       
>                       return javaInstance;
>               }
>               else
>               {
>                       
>                         L javaInstance = javaType.newInstance();
>                         ......
>                         return javaInstance;
>               }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to