| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one |
| ~ or more contributor license agreements. See the NOTICE file |
| ~ distributed with this work for additional information |
| ~ regarding copyright ownership. The ASF licenses this file |
| ~ to you under the Apache License, Version 2.0 (the |
| ~ "License"); you may not use this file except in compliance |
| ~ with the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, |
| ~ software distributed under the License is distributed on an |
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~ KIND, either express or implied. See the License for the |
| ~ specific language governing permissions and limitations |
| ~ under the License. |
| --> |
| <process name="http-binding-ext-POST" |
| targetNamespace="http://ode/bpel/unit-test" |
| xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" |
| xmlns:tns="http://ode/bpel/unit-test" |
| xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
| xmlns:test="http://ode/bpel/unit-test.wsdl" |
| xmlns:dummy="http://ode/bpel/test/blog" |
| queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" |
| expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"> |
| |
| <import location="http-binding-ext-POST.wsdl" |
| namespace="http://ode/bpel/unit-test.wsdl" |
| importType="http://schemas.xmlsoap.org/wsdl/"/> |
| |
| <partnerLinks> |
| <partnerLink name="helloPartnerLink" |
| partnerLinkType="test:HelloPartnerLinkType" myRole="me"/> |
| <partnerLink name="blogPartnerLink" |
| partnerLinkType="test:BlogLinkType" partnerRole="you"/> |
| </partnerLinks> |
| |
| <variables> |
| <variable name="inputVar" messageType="test:HelloMessage"/> |
| <variable name="outputVar" messageType="test:HelloMessage"/> |
| <variable name="commentMsg" messageType="dummy:CommentRequest"/> |
| <variable name="noPartMsg" messageType="dummy:NoPartMessage"/> |
| <variable name="myvar" type="xsd:string"/> |
| </variables> |
| <sequence> |
| <receive name="start" partnerLink="helloPartnerLink" portType="test:HelloPortType" |
| operation="hello" variable="inputVar" createInstance="yes"/> |
| |
| <!-- Initialize output var --> |
| <assign> |
| <copy> |
| <from>'What a success!'</from> |
| <to>$outputVar.TestPart</to> |
| </copy> |
| </assign> |
| |
| <!-- Prepare the input message --> |
| <assign> |
| <copy> |
| <from>string(round(seconds-from-dateTime(current-dateTime())))</from> |
| <to>$commentMsg.articleId</to> |
| </copy> |
| <copy> |
| <from>string(round(seconds-from-dateTime(current-dateTime())))</from> |
| <to>$commentMsg.articleId</to> |
| </copy> |
| <copy> |
| <from> |
| <litteral> |
| <dummy:comment> |
| <dummy:author>Voltaire</dummy:author> |
| <dummy:content>When it is a question of money, everybody is of the same religion.</dummy:content> |
| </dummy:comment> |
| </litteral> |
| </from> |
| <to>$commentMsg.comment</to> |
| </copy> |
| </assign> |
| |
| <invoke partnerLink="blogPartnerLink" portType="dummy:BlogPortType" |
| operation="doPOST" inputVariable="commentMsg" outputVariable="noPartMsg"/> |
| |
| <!-- Check the Location Header --> |
| <assign> |
| <copy> |
| <from variable="noPartMsg" header="Location"/> |
| <to>$myvar</to> |
| </copy> |
| </assign> |
| |
| <if> |
| <condition>string-length($myvar) != 0</condition> |
| <empty/> |
| <else> |
| <assign> |
| <copy> |
| <from>'Empty Location Header received.'</from> |
| <to>$outputVar.TestPart</to> |
| </copy> |
| </assign> |
| </else> |
| </if> |
| |
| <reply name="end" partnerLink="helloPartnerLink" portType="test:HelloPortType" |
| operation="hello" variable="outputVar"/> |
| </sequence> |
| |
| </process> |