Hi,
I am trying to build a BPEL process that will initiate the
communication with some "partner" service and later on will block in
waiting a callback form this service. So it will basically contain a
<invoke> and a <receive> (for the callback) inn a sequence. It seems
that I am confused with the way ODE supports this use case. From
<http://ode.apache.org/implicit-correlations.html> and the
magicSession example it seems that the <invoke>/<receive> combination
will do the trick with no need for correlation. But in the same web
page for a process to service interaction it is said that the
"Stateful Exchange Protocol" should be used instead according to
<http://ode.apache.org/stateful-exchange-protocol.html> But the
"Stateful Exchange Protocol" documentation lacks any example of use
(although I understand the notion of state, state identifiers, etc.
some example would be much clearer). Also I just don't see the need
for having state in this specific scenario, what I need is my process
to accept the callback which as I see it would be enough with the
simple "implicit correlation" (I assume that the session identifier
will be passed as a SOAP/WS-Addr header somehow...)

I have used the EclipseBPEL plugin (and actually the Lompoz
distribution which has better integration with ODE,
http://lomboz.objectweb.org/downloads/drops/R-3.3-200710290621/) to
create a sample process (called Test2, please check attached files).
After various tests I have not managed to find a working solution.. A
major obstacle seems to be how to specify the endpoint reference for
the callback (which should be the process itself), which with the
"correlation" issue makes things quite complex. Can you please take a
look and either provide some example for this kind of (common)
scenario or at least some guidance/workaround?

thank you for your time!
best regards
Stelios
<?xml version="1.0"?>
<definitions name="Test2"
        targetNamespace="urn:test2:stelios"
        xmlns:tns="urn:test2:stelios"
        xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype";
        xmlns="http://schemas.xmlsoap.org/wsdl/";
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     TYPE DEFINITION - List of types participating in this BPEL process 
     The BPEL Designer will generate default request and response types
     but you can define or import any XML Schema type and use them as part 
     of the message types.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    
    <types>
        <schema attributeFormDefault="unqualified" elementFormDefault="qualified" 
                targetNamespace="urn:test2:stelios" 
                xmlns="http://www.w3.org/2001/XMLSchema";>

            <element name="Test2Request">
                <complexType>
                    <sequence>
                        <element name="input" type="string"/>
                    </sequence>
                </complexType>
            </element>

            <element name="Test2Response">
                <complexType>
                    <sequence>
                        <element name="result" type="string"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
    </types>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     MESSAGE TYPE DEFINITION - Definition of the message types used as 
     part of the port type defintions
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    
    <message name="Test2RequestMessage">
        <part name="payload" element="tns:Test2Request"/>
    </message>
    <message name="Test2ResponseMessage">
        <part name="payload" element="tns:Test2Response"/>
    </message>

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PORT TYPE DEFINITION - A port type groups a set of operations into
     a logical service unit.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    

    <!-- portType implemented by the Test2 BPEL process -->
    <portType name="Test2">
        <operation name="process">
            <input  message="tns:Test2RequestMessage" />
            <output message="tns:Test2ResponseMessage"/>
        </operation>
    </portType>
  

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PARTNER LINK TYPE DEFINITION
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->    
    <plnk:partnerLinkType name="Test2">
        <plnk:role name="Test2Provider" portType="tns:Test2"/>
    </plnk:partnerLinkType>
    
    <binding name="NewBinding" type="tns:Test2">
    	<soap:binding style="document"
    		transport="http://schemas.xmlsoap.org/soap/http";>
    	</soap:binding>
    	<operation name="process">
    		<soap:operation soapAction="urn:test2:stelios/process"></soap:operation>
    		<input>
    			<soap:body use="literal"></soap:body>
    		</input>
    		<output>
    			<soap:body use="literal"></soap:body>
    		</output>
    	</operation>
    </binding>
    <service name="Test2Service">
    	<port name="Test2Port" binding="tns:NewBinding">
    		<soap:address location="http://localhost:8080/ode/processes/Test2"; />
    	</port>
    </service>
</definitions>
<?xml version="1.0"?>
<definitions name="HelloWorld"
        targetNamespace="http://sample.bpel.org/bpel/sample";
        xmlns:tns="http://sample.bpel.org/bpel/sample";
        xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/";
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
        xmlns="http://schemas.xmlsoap.org/wsdl/";
        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        >

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     TYPE DEFINITION - List of services participating in this BPEL process 
     The default output of the BPEL designer uses strings as input and 
     output to the BPEL Process. But you can define or import any XML 
     Schema type and us them as part of the message types.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    
    <types>  
        <schema attributeFormDefault="unqualified" 
                elementFormDefault="qualified" 
                targetNamespace="http://sample.bpel.org/bpel/sample"; 
                xmlns="http://www.w3.org/2001/XMLSchema";
                xmlns:xsd="http://www.w3.org/2001/XMLSchema";
                >
                
            <element name="HelloWorldRequest">
                <complexType>
                    <sequence>
                        <element name="input" type="xsd:string" />
                    </sequence>
                </complexType>
            </element>
                  
            <element name="HelloWorldResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="xsd:string"/>
                    </sequence>
                </complexType>
            </element>
            
        </schema>
    </types>
  
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     MESSAGE TYPE DEFINITION - Definition of the message types used as 
     part of the port type defintions
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    
    <message name="HelloWorldRequestMessage">
        <part name="payload" element="tns:HelloWorldRequest"/>
    </message>
    
    <message name="HelloWorldResponseMessage">
        <part name="payload" element="tns:HelloWorldResponse"/>
    </message>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PORT TYPE DEFINITION - A port type groups a set of operations into
     a logical service unit.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->
    <!-- portType implemented by the HelloWorld BPEL process -->
    <portType name="MyHelloWorld">
        <operation name="initiate">
            <input message="tns:HelloWorldRequestMessage"/>
        </operation>
    </portType>

    <!-- portType implemented by the requester of HelloWorld BPEL process 
         for asynchronous callback purposes
         -->
    <portType name="HelloWorldCallback">
        <operation name="onResult">
            <input message="tns:HelloWorldResponseMessage"/>
        </operation>
    </portType>


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     PARTNER LINK TYPE DEFINITION
         the HelloWorld partnerLinkType binds the provider and
         requester portType into an asynchronous conversation.
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->    
    <plnk:partnerLinkType name="MyHelloWorld">
        <plnk:role name="HelloWorldProvider" portType="tns:MyHelloWorld"/>
        <plnk:role name="HelloWorldRequester"
portType="tns:HelloWorldCallback"/>
    </plnk:partnerLinkType> 
    

<binding name="HelloWorldSoapBinding" type="tns:MyHelloWorld">
        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="initiate">
           <soap:operation soapAction="http://sample.bpel.org/bpel/sample"/>
           <input>
               <soap:body use="literal"/>
           </input>
        </operation>
    </binding>

<binding name="HelloWorldResponseSoapBinding" type="tns:HelloWorldCallback">
        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="onResult">
           <soap:operation soapAction="http://sample.bpel.org/bpel/sample"/>
           <input>
               <soap:body use="literal"/>
           </input>
        </operation>
    </binding>


    <service name="MyHelloWorldService">
        <documentation>Test service</documentation>
        <port name="MyHelloWorld" binding="tns:HelloWorldSoapBinding">
           <soap:address
location="http://hii:9090/ode/processes/myhelloWorld"/>
        </port>
    </service>

    <service name="MyHelloWorldResponderService">
        <documentation>Test service</documentation>
        <port name="HelloWorldCallbackPort"
binding="tns:HelloWorldResponseSoapBinding">
           <soap:address
location="http://localhost:8080/ode/processes/Test2"/>
        </port>
    </service>

</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"; xmlns:tns="urn:test2:steliosArtifacts" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop"; xmlns:wsdl="http://sample.bpel.org/bpel/sample"; name="Test2Artifacts" targetNamespace="urn:test2:steliosArtifacts" xmlns="http://schemas.xmlsoap.org/wsdl/";>
  <plnk:partnerLinkType name="EchoHelloPLT">
    <plnk:role name="EchoHelloServer" portType="wsdl:MyHelloWorld"/>
    <plnk:role name="EchoHelloRequester" portType="wsdl:HelloWorldCallback"/>
  </plnk:partnerLinkType>
  <import location="AsyncHello.wsdl" namespace="http://sample.bpel.org/bpel/sample"/>
</definitions>
<?xml version="1.0" encoding="utf-8" ?>

<!--
###############################################################################
# Copyright (c)  2007 Naci Dai, Eteration A.S. and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
# 
# Contributors:
#     Naci Dai  - initial API and implementation
#     Eteration A.S.   
###############################################################################
-->
<wsdl:definitions
    targetNamespace="urn:test2:stelios"
    xmlns="http://schemas.xmlsoap.org/wsdl/";
    xmlns:pns="urn:test2:stelios"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
    xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable";
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype";
    xmlns:prop="http://docs.oasis-open.org/wsbpel/2.0/varprop";>

  <import namespace="urn:test2:stelios" 
        location="Test2.wsdl"/>

  <wsdl:binding name="NewBinding" 
      type="pns:Test2">

    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http"; />
    <wsdl:operation name="process">
      <soap:operation  soapAction="" style="document"/>
      <wsdl:input>
        <soap:body namespace="urn:test2:stelios" use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body namespace="urn:test2:stelios" use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Test2Service">
    <wsdl:port name="Test2Port" 
         binding="pns:NewBinding">
      <soap:address location="http://localhost:8080/ode/processes/Test2"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
<?xml version="1.0" encoding="utf-8" ?>
<!--
###############################################################################
# Copyright (c)  2007 Naci Dai, Eteration A.S. and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
# 
# Contributors:
#     Naci Dai  - initial API and implementation
#     Eteration A.S.   
###############################################################################
-->
<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03";
  xmlns:plnkTest20="http://sample.bpel.org/bpel/sample";
  xmlns:plnkTest21="urn:test2:stelios"
  xmlns:plnkTest22="http://sample.bpel.org/bpel/sample";
  xmlns:pnsTest2="urn:test2:stelios"
>

  <process name="pnsTest2:Test2">
    <active>true</active>    
    <invoke
      partnerLink="EchoHelloPL">
      <service name="plnkTest20:MyHelloWorldResponderService" port="HelloWorldCallbackPort" />
    </invoke>    

    <provide partnerLink="client">
      <service name="plnkTest21:Test2Service" port="Test2Port" />
    </provide>    

    <provide partnerLink="EchoHelloPL">
      <service name="plnkTest22:MyHelloWorldResponderService" port="HelloWorldCallbackPort" />
    </provide>
  </process>
</deploy>

Reply via email to