WSO2-bpel:doXslTransform

WSO2-bpel:doXslTransform,wso2,Wso2,请查看下面的bpel代码(WSO2) 建议:尝试调试您的流程,添加变量,以便打印某个“断点”,然后: -发送请求 -等待进程完成 -打开控制台 -选择您的流程 -点击“完成”链接 -单击流程实例 -检查变量 另外:将日志置于调试/跟踪模式,以便查看进程的行为 问候 克劳迪奥 <bpel:assign validate="no" name="Assign"> <bpel:copy> <bpel:from>

请查看下面的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>
<!-- 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>