我是 BPEL 和 Web 服务的新手。 我有一个返回字符串数组的网络服务。在 BPEL 中,我调用此 Web 服务并在 Apache ODE 中部署该 Web 服务。 我正在 Eclipse 中使用 BPEL 设计器工具。
我从 BPEL 服务获得的结果是数组中的第一个元素,在控制台中我可以看到整个数组正在被传递。如何将输出设置为数组?我的输出变量的类型是 String,我找不到列表、数组或字符串列表等类型。
此字符串列表:
<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>
应该放在这个:
<complexType name="Bungalow">
<sequence maxOccurs="unbounded" minOccurs="0">
<element name="bungalowInfo" type="string"></element>
</sequence>
</complexType>
Bpel 从到看起来像这样:
<bpel:copy>
<bpel:from part="parameters" variable="HolidayVillageServiceLinkResponse">
</bpel:from>
<bpel:to part="bungalows" variable="output">
</bpel:to>
</bpel:copy>
我在 BPEL 设计器中遇到的错误如下:
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
最佳答案
BPEL 中的类型是根据 XMLSchema 定义的,因此不存在数组或列表之类的概念,但您可以通过将基数设置为无界来定义字符串元素序列。如果您需要组装返回值的字符串列表,另请参阅 here
关于web-services - BPEL 输出字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14174572/