Foros de discusión

Create complex type entity using service builder

thumbnail
Steve Weiss, modificado hace 10 años.

Create complex type entity using service builder

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
I need to create a web service that returns an array of a custom object type. The object itself needs to have an array of fields that are also complex types. Basically I want my wsdl to have something like this:

<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://service.portal.liferay.com">
<import namespace="http://model.announcements.portlet.liferay.com" />
<import namespace="http://util.java" />
<import namespace="http://http.servlet.javax" />
<import namespace="http://persistence.service.portal.liferay.com" />
<import namespace="http://xml.apache.org/xml-soap" />
<import namespace="urn:http.service.portal.liferay.com" />
<import namespace="http://model.portal.liferay.com" />
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />

<complexType name="liferay_GenericObject">
<all>
<element minOccurs="0" name="properties"
type="impl:ArrayOf_liferay_Property" />
<element minOccurs="0" name="uuid" type="xsd:string" />
<element minOccurs="0" name="webId" type="xsd:string" />
</all>
</complexType>

<complexType name="liferay_Property">
<all>
<element minOccurs="0" name="name" type="xsd:string" />
<element minOccurs="0" name="value" type="xsd:string" />
</all>
</complexType>

<complexType name="ArrayOf_liferay_Property">
<complexContent>
<restriction base="soapenc:Array">
<sequence>
<element name="properties" minOccurs="0"
maxOccurs="unbounded" type="impl:liferay_Property" />
</sequence>
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:liferay_Property[]" />
</restriction>
</complexContent>
</complexType>

<complexType name="ArrayOf_liferay_GenericObject">
<complexContent>
<restriction base="soapenc:Array">
<sequence>
<element name="object" minOccurs="0" maxOccurs="unbounded"
type="impl:liferay_GenericObject" />
</sequence>
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:liferay_GenericObject[]" />
</restriction>
</complexContent>
</complexType>

</schema>
</wsdl:types>

A Liferay_GenericObjectg would hold an array of type liferay_Property which in turn has a field called "name" and another field called "property". I do not want any database tables created. Is this possible using service builder?
thumbnail
David H Nebinger, modificado hace 10 años.

RE: Create complex type entity using service builder

Liferay Legend Mensajes: 14916 Fecha de incorporación: 2/09/06 Mensajes recientes
No. SB only supports entities of primitives, their object counterparts, and partially collections.

You can return an array of entities, but the entities cannot have complex entity members nor can they be collections of other entities.
thumbnail
Steve Weiss, modificado hace 10 años.

RE: Create complex type entity using service builder

Regular Member Mensajes: 107 Fecha de incorporación: 20/09/11 Mensajes recientes
Ok, thanks. That's what I thought.