2
votes

I am new to BPEL and web services. I have a webservice returning an array of strings. In BPEL I invoke this webservice and deploy the webservice in Apache ODE. I am using the BPEL designer tool in Eclipse.

The result I get from the BPEL service is the first element in the array, in the console I can see that the whole array is being passed. How can I set the output as array? The type of my output variable is String, I can not find a type such as list, array or list of strings.

This list of strings:

<xs:element name="getAvailableBungalowsResponse">
            <xs:complexType>
                <xs:sequence>
                    <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>

should go in this one:

<complexType name="Bungalow">

            <sequence maxOccurs="unbounded" minOccurs="0">
                <element name="bungalowInfo" type="string"></element>
            </sequence>
        </complexType>

Bpel from-to looks like this:

<bpel:copy>
            <bpel:from part="parameters" variable="HolidayVillageServiceLinkResponse">
            </bpel:from>
            <bpel:to part="bungalows" variable="output">
            </bpel:to>
        </bpel:copy>

Error I get in the BPEL designer is the following:

The from-spec of "<xs:complexType>" is not compatible with to-spec of "<complexType "Bungalow">" - Element <ns:return> in platform:/resource/HolidayVillage/bpelContent/HollidayVillage.wsdl differs from <tns:bungalowInfo> in platform:/resource/HolidayVillage/bpelContent/HolidayVillageReservationArtifacts.wsdl - different QNames: ns:return vs tns:bungalowInfo HolidayVillageReservation.bpel  /HolidayVillage/bpelContent line 98 BPEL Validation Marker
1

1 Answers

2
votes

Types in BPEL are defined in terms of XMLSchema, thus there is no concept like an array or list but you can define a sequence of string elements by setting the cardinality to unbounded. If you need to assemble a list of strings for the return value, please also see here