2

我正在使用 Eclipse BPEL Designer 和 Apache ODE。当我部署时,我收到此错误:

error: [MessageVariableRequired] Cannot use non-message variable "getDetailInfoRequest" in this context (message variable is required).

这是我的 BPEL 代码:

<?xml version="1.0" encoding="UTF-8"?>
<bpel:process exitOnStandardFault="yes" name="lngProcess.bpel"
    targetNamespace="http://services.lng"
    xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:ns="http://services.lngArtifacts" xmlns:ns0="http://services.lng">
    <bpel:import importType="http://schemas.xmlsoap.org/wsdl/"
        location="Main.wsdl" namespace="http://services.lng"/>
    <bpel:import importType="http://schemas.xmlsoap.org/wsdl/"
        location="lngProcessArtifacts.wsdl" namespace="http://services.lngArtifacts"/>
    <bpel:partnerLinks>
        <bpel:partnerLink myRole="MainPortTypeRole"
            name="bpelProcessPartner" partnerLinkType="ns:MainPortTypePLT"/>
    </bpel:partnerLinks>
    <bpel:variables>
        <bpel:variable element="ns0:getDetailInfo" name="getDetailInfoRequest"/>
        <bpel:variable element="ns0:getDetailInfoResponse" name="getDetailInfoResponse"/>
        <bpel:variable element="ns0:getSummaryInvoice" name="getSummaryInvoiceRequest"/>
    </bpel:variables>
    <bpel:sequence name="MainSequence">
        <bpel:pick createInstance="yes" name="SwitchInvokedOperation">
            <bpel:onMessage operation="getDetailInfo"
                partnerLink="bpelProcessPartner"
                portType="ns0:MainPortType" variable="getDetailInfoRequest">
                <bpel:reply name="ReplyToGetDetailInfo"
                    operation="getDetailInfo"
                    partnerLink="bpelProcessPartner"
                    portType="ns0:MainPortType" variable="getDetailInfoResponse"/>
            </bpel:onMessage>
            <bpel:onMessage operation="getSummaryInvoice"
                partnerLink="bpelProcessPartner"
                portType="ns0:MainPortType" variable="getSummaryInvoiceRequest">
                <bpel:reply name="ReplyToGetSummaryInvoice"
                    operation="getSummaryInvoice"
                    partnerLink="bpelProcessPartner"
                    portType="ns0:MainPortType" variable="getSummaryInvoiceResponse"/>
            </bpel:onMessage>
        </bpel:pick>
        <bpel:assign validate="no" name="AssignGetDetailInfo">
            <bpel:copy>
                <bpel:from>
                    <literal>
                        <message xmlns="">
                            <parameters></parameters>
                        </message>
                    </literal>
                </bpel:from>
                <bpel:to></bpel:to>
            </bpel:copy>
        </bpel:assign>
    </bpel:sequence>
</bpel:process>

在我的 WSDL SourceMain.wsdl中不包括消息类型:

<wsdl:message name="getDetailInfoRequest">
        <wsdl:part name="parameters" element="ns:getDetailInfo"/>
    </wsdl:message>
    <wsdl:message name="getDetailInfoResponse">
        <wsdl:part name="parameters" element="ns:getDetailInfoResponse"/>
    </wsdl:message>
    <wsdl:message name="getSummaryInvoiceRequest">
        <wsdl:part name="parameters" element="ns:getSummaryInvoice"/>
    </wsdl:message>

经过一番搜索,我知道我必须添加以下代码:

<bpel:assign validate="no" name="AssignGetDetailInfo">
            <bpel:copy>
                <bpel:from>
                    <literal>
                        <message xmlns="">
                            <parameters></parameters>
                        </message>
                    </literal>
                </bpel:from>
                <bpel:to></bpel:to>
            </bpel:copy>
        </bpel:assign>

但我不知道bpel:fromand的价值是什么bpel:to。导致我的 WSDL 没有明确包含消息类型。

我该如何解决?谢谢你。

4

1 回答 1

2

ODE 不支持将变量定义为要在 Receive 和 Invoke 活动中使用的元素。请参考这里!因此,使用对应于适当 wsdl 消息的 messageType 定义 bpel 变量。

于 2015-09-11T10:10:42.947 回答