请查看下面的bpel代码(WSO2)。
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
bpel:doXslTransform("RequestAdd.xsl", $input.payload)
</bpel:from>
<bpel:to variable="Request" part="payload"></bpel:to>
</bpel:copy>
</bpel:assign>我尝试使用BPEL中的xslt将输入传递给外部加法服务。$input和$request是消息类型。但似乎请求没有正确传递到加法服务。请帮我解决这个问题。下面是BPEL代码
<!-- InvokeUsingXSLT BPEL Process [Generated by the Eclipse BPEL Designer] -->
<!-- Date: Mon Mar 05 12:13:11 IST 2012 -->
<bpel:process name="InvokeUsingXSLT"
targetNamespace="http://wso2.org/bps/sample"
suppressJoinFailure="yes"
xmlns:tns="http://wso2.org/bps/sample"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
>
<!-- Import the client WSDL -->
<bpel:import namespace="http://wso2.org/bps/sample" location="AddService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
<bpel:import location="InvokeUsingXSLTArtifacts.wsdl" namespace="http://wso2.org/bps/sample"
importType="http://schemas.xmlsoap.org/wsdl/" />
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:InvokeUsingXSLT"
myRole="InvokeUsingXSLTProvider"
/>
<bpel:partnerLink name="Add_service" partnerLinkType="tns:Add_service" partnerRole="Add_serviceProvider"></bpel:partnerLink>
</bpel:partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:InvokeUsingXSLTRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:InvokeUsingXSLTResponseMessage"/>
<bpel:variable name="Request" messageType="tns:Add_serviceRequestMessage"></bpel:variable>
<bpel:variable name="Response" messageType="tns:Add_serviceResponseMessage"></bpel:variable>
</bpel:variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in InvokeUsingXSLT.wsdl
-->
<bpel:receive name="receiveInput" partnerLink="client"
portType="tns:InvokeUsingXSLT"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
bpel:doXslTransform("RequestAdd.xsl", $input.payload)
</bpel:from>
<bpel:to variable="Request" part="payload"></bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:log></bpel:log>
<bpel:invoke name="Invoke" partnerLink="Add_service" operation="process" portType="tns:Add_service" inputVariable="Request" outputVariable="Response"></bpel:invoke>
<bpel:assign validate="no" name="Assign1">
<bpel:copy>
<bpel:from><bpel:literal><tns:InvokeUsingXSLTResponse xmlns:tns="http://wso2.org/bps/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns:result>0</tns:result>
</tns:InvokeUsingXSLTResponse>
</bpel:literal></bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
bpel:doXslTransform("ResponseAdd.xsl", $Response.payload)
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="replyOutput"
partnerLink="client"
portType="tns:InvokeUsingXSLT"
operation="process"
variable="output"
/>
</bpel:sequence>
</bpel:process>发布于 2015-11-20 11:14:06
建议:尝试调试您的进程添加变量,在其中您可以打印一些“断点”,然后:-send请求-wait,直到流程完成-open为止,在流程实例上的“完整”链接-click上的-select -select process -click上显示您的变量。
另外:将日志置于调试/跟踪模式中,这样您就可以看到进程的行为。
问候克劳迪奥
https://stackoverflow.com/questions/30474876
复制相似问题