Hi Alfredo,

we're using successfully arrays of objects in SOAP services. 
The ObjectType.class in the trunk should support arrays
(https://issues.apache.org/jira/browse/OFBIZ-1008).

This should work for simple data types. If you're using complex types then
it will be more
complicated because you have to register the BeanSerializer/BeanDeserializer
for the type.
Set a breakpoint in the method SOAPEventHandler.invoke(..) and try to
understand what
happens there... 

Regards,
Michael



Alfredo Rueda wrote:
> 
> Hello Michael!
> 
> Have you manage to handle arrays of objects as output parameters of an
> ofbiz service exported via soap?
> 
> Thank you very much!
> 
> Alfredo
> 
> 
> Michael Imhof wrote:
>> 
>> After a while a found a way to create and process SOAP request
>> with complex types in OfBiz:
>> 
>> 1). Use Java2WSDL to create a WSDL. This allows you to use complex types.
>>     javac: Compile the class with option -g to get debug infos (e.g. real
>> argument names instead of arg0, arg1,...)
>>     Java2WSDL: Use parameter -A OPERATION.
>> 
>> 2). Property: axis.doAutoTypes should be true. If not, no serializer
>> could be found.
>>      I put this in Start.java:
>>        System.setProperty("axis.doAutoTypes", Boolean.TRUE.toString());
>> 
>> 3). The complex type class should implement:
>>            public static org.apache.axis.description.TypeDesc
>> getTypeDesc():
>>      For a class ComplexType with a string attribute <name>, TypeDesc
>> should look like this:
>> 
>>      org.apache.axis.description.TypeDesc typeDesc =new
>> org.apache.axis.description.TypeDesc(ComplexTest.class, true);
>>      typeDesc.setXmlType(new
>> javax.xml.namespace.QName("http://types.archiv.isgate.nowhow.ch";,
>> "ComplexTest"));
>>      org.apache.axis.description.ElementDesc elemField = new
>> org.apache.axis.description.ElementDesc();
>>      elemField.setFieldName("name");
>>      elemField.setXmlName(new javax.xml.namespace.QName("", "name"));
>>      elemField.setXmlType(new
>> javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "string"));
>>      typeDesc.addFieldDesc(elemField);
>> 
>> Now you can generate Services with a complex type ComplexType. 
>>     <service name="testService" engine="java"
>> location="ch.nowhow.isgate.archiv.ArchivServices"
>>         invoke="testService" export="true">
>>         <namespace>http://nowhow.ch/isgate/</namespace>
>>         <attribute name="inList"
>> type="ch.nowhow.isgate.archiv.types.ComplexTest" mode="IN"
>>             optional="false"/>
>>     </service>
>> 
>> If you want to use arrays of complex types (or simply array of string),
>> you should enhance ObjectType.java to support arrays...but this is
>> another story and
>> I'm still testing my changes
>> (https://issues.apache.org/jira/browse/OFBIZ-746):-)
>> 
>> Regards 
>> Michael
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-SOAP-complex-types-with-OfBiz-tp9180865p20617645.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Reply via email to