Foros

Inicio » Liferay IDE » English

Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Steve Weiss
Create complex type entity using service builder
4 de noviembre de 2013 13:04
Respuesta

Steve Weiss

Ranking: New Member

Mensajes: 12

Fecha de incorporación: 20 de septiembre de 2011

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?
David H Nebinger
RE: Create complex type entity using service builder
4 de noviembre de 2013 14:38
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 11464

Fecha de incorporación: 1 de septiembre de 2006

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.
Steve Weiss
RE: Create complex type entity using service builder
5 de noviembre de 2013 9:23
Respuesta

Steve Weiss

Ranking: New Member

Mensajes: 12

Fecha de incorporación: 20 de septiembre de 2011

Mensajes recientes

Ok, thanks. That's what I thought.