You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "ant elder (JIRA)" <tu...@ws.apache.org> on 2007/09/15 15:04:32 UTC
[jira] Updated: (TUSCANY-1683) AXIS data binding can not process
array Type response
[ https://issues.apache.org/jira/browse/TUSCANY-1683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ant elder updated TUSCANY-1683:
-------------------------------
Fix Version/s: Java-SCA-1.0
> 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-1.0
>
>
> 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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org