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 deployed on ODE correctly. 

The following codes can invoke an ordinary WebService, but fails to call the
process above. 
***************************************************************** 
import javax.xml.namespace.QName; 
import org.apache.axis2.AxisFault; 
import org.apache.axis2.addressing.EndpointReference; 
import org.apache.axis2.client.Options; 
import org.apache.axis2.rpc.client.RPCServiceClient; 

public class MyClient1 { 
    private static EndpointReference targetEPR = new
EndpointReference("http://localhost:8080/ode/processes/int2int";); 
    public static void main(String args[]) throws AxisFault { 
        RPCServiceClient  serviceClient = new RPCServiceClient(); 
        Options options = serviceClient.getOptions(); 
      options.setTo(targetEPR); 
                        
        QName operation = new QName("http://pai.com/int2int";, "process"); 
        Integer a=new Integer(3); 
        Object[] params = new Object[] {a}; 
        Class[] returnTypes = new Class[] { Integer.class }; 
        serviceClient.invokeBlocking(operation, params, returnTypes); 
        Object[] response = serviceClient.invokeBlocking(operation, params,
returnTypes); 
        System.out.print(response[0].toString()); 
} 
} 
****************************************************************** 
Can anyone tell me what's the problem, or how to call this process
correctly? 

Best regards, 
Pai 

-- 
View this message in context: 
http://www.nabble.com/How-to-call-a-bpel-process-as-an-ordinary-web-service--tp23091707p23091707.html
Sent from the Apache Ode User mailing list archive at Nabble.com.

Reply via email to