You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Pai_1228 <zh...@live.cn> on 2009/04/17 07:41:32 UTC

Question about calling a BPEL process in java?

Hi, everybody,
I want to invoke an ODE bpel process as an ordinary WebService:
Here is a my bpel file
*********************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<bpws:process
xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://pai.com/int2int"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" exitOnStandardFault="yes"
name="Int_2_Int" suppressJoinFailure="yes"
targetNamespace="http://pai.com/int2int">
   <bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
location="Int_2_Int.wsdl" namespace="http://pai.com/int2int"/>
   <bpws:partnerLinks>
      <bpws:partnerLink myRole="Int_2_IntProvider" name="client"
partnerLinkType="tns:Int_2_Int"/>
   </bpws:partnerLinks>
   <bpws:variables>
      <bpws:variable messageType="tns:Int_2_IntRequestMessage"
name="input"/>
      <bpws:variable messageType="tns:Int_2_IntResponseMessage"
name="output"/>
   </bpws:variables>
   <bpws:sequence name="main">
      <bpws:receive createInstance="yes" name="receiveInput"
operation="process" partnerLink="client" variable="input"/>
      <bpws:assign name="Assign">
         <bpws:copy>
            <bpws:from>
               <bpws:literal>
                  <ns0:Int_2_IntResponse xmlns:ns0="http://pai.com/int2int">
                            <ns0:result>0</ns0:result>
                        </ns0:Int_2_IntResponse>
               </bpws:literal>
            </bpws:from>
            <bpws:to part="payload" variable="output"/>
         </bpws:copy>
         <bpws:copy>
            <bpws:from>$input.payload/tns:input * 3</bpws:from>
            <bpws:to part="payload" variable="output">
               <bpws:query>/tns:result</bpws:query>
            </bpws:to>
         </bpws:copy>
      </bpws:assign>
      <bpws:reply name="replyOutput" operation="process"
partnerLink="client" variable="output"/>
   </bpws:sequence>
</bpws:process>
*********************************************************************
And here is the wsdl file:
*********************************************************************
<?xml version="1.0"?>
<definitions name="Int_2_Int"
        targetNamespace="http://pai.com/int2int"
        xmlns:tns="http://pai.com/int2int"
        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/">

    <types>
        <schema attributeFormDefault="unqualified"
elementFormDefault="qualified" 
                targetNamespace="http://pai.com/int2int" 
                xmlns="http://www.w3.org/2001/XMLSchema">

            <element name="Int_2_IntRequest">
                <complexType>
                    <sequence>
                        <element name="input" type="int"/>
                    </sequence>
                </complexType>
            </element>

            <element name="Int_2_IntResponse">
                <complexType>
                    <sequence>
                        <element name="result" type="int"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
    </types>

    <message name="Int_2_IntRequestMessage">
        <part name="payload" element="tns:Int_2_IntRequest"/>
    </message>
    <message name="Int_2_IntResponseMessage">
        <part name="payload" element="tns:Int_2_IntResponse"/>
    </message>

    <portType name="Int_2_Int">
        <operation name="process">
            <input  message="tns:Int_2_IntRequestMessage" />
            <output message="tns:Int_2_IntResponseMessage"/>
        </operation>
    </portType>
  
    <plnk:partnerLinkType name="Int_2_Int">
        <plnk:role name="Int_2_IntProvider" portType="tns:Int_2_Int"/>
    </plnk:partnerLinkType>
    
    <binding name="Int2IntBinding" type="tns:Int_2_Int">
    	<soap:binding style="document"
    		transport="http://schemas.xmlsoap.org/soap/http" />
    	<operation name="process">
    		<soap:operation soapAction="http://pai.com/int2int/process" />
    		<input>
    			<soap:body use="literal" />
    		</input>
    		<output>
    			<soap:body use="literal" />
    		</output>
    	</operation>
    </binding>
    <service name="Int2IntService">
    	<port name="Int2IntPort" binding="tns:Int2IntBinding">
    		<soap:address
location="http://localhost:8080/ode/processes/int2int"></soap:address>
    	</port>
    </service>
</definitions>
*****************************************************************
The process have been deplyed on ODE correctly.
I failed to call it in java with axis2. 
Can anyone show how to call this process?

Best regards,
Pai

-- 
View this message in context: http://www.nabble.com/Question-about-calling-a-BPEL-process-in-java%EF%BC%9F-tp23091405p23091405.html
Sent from the Apache Ode User mailing list archive at Nabble.com.