Please show specific call statement. 
I invoke bpel process through blowing statement:
call.setTargetEndpointAddress(new URL(endpoints));
call.setOperationStyle("wrapped");
call.setOperationName(new QName("http://www.icrm.org/test/","process";));
call.setSOAPActionURI("http://www.icrm.org/test/process";);
call.addParameter("type",org.apache.axis.Constants.XSD_STRING,
ParameterMode.IN);
call.addParameter("left",org.apache.axis.Constants.XSD_INT,ParameterMode.IN);
call.addParameter("right",org.apache.axis.Constants.XSD_INT,ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_INT);
Integer res=(Integer)call.invoke(new Object[]{"add",new Integer(3),new
Integer(4)});
SOAP Request message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<soapenv:Body>
<process xmlns="http://www.icrm.org/test/";>
<type xsi:type="xsd:string" xmlns="">add</type>
<left xsi:type="xsd:int" xmlns="">3</left>
<right xsi:type="xsd:int" xmlns="">4</right>
</process>
</soapenv:Body>
</soapenv:Envelope>
SOAP Response message
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
<soapenv:Body>
<soapenv:Fault xmlns:java="java:packageorg.apache.ode.axis2">
<faultcode>java:org.apache.ode.axis2.OdeFault</faultcode>
<faultstring>An exception occured while invoking ODE.</faultstring>
<detail>
<Exception>org.apache.ode.axis2.OdeFault: An exception occured while
invoking ODE.&#xd;
        at
org.apache.ode.axis2.ODEService.onAxisMessageExchange(ODEService.java:134)&#xd;
        at
org.apache.ode.axis2.hooks.ODEMessageReceiver.invokeBusinessLogic(ODEMessageReceiver.java:67)&#xd;
        at
org.apache.ode.axis2.hooks.ODEMessageReceiver.invokeBusinessLogic(ODEMessageReceiver.java:50)&#xd;
        at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)&#xd;
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)&#xd;
        at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)&#xd;
        at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)&#xd;
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)&#xd;
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)&#xd;
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)&#xd;
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)&#xd;
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)&#xd;
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)&#xd;
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)&#xd;
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)&#xd;
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)&#xd;
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)&#xd;
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)&#xd;
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)&#xd;
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)&#xd;
        at java.lang.Thread.run(Thread.java:595)&#xd;
Caused by: org.apache.ode.axis2.OdeFault: Unexpected element in SOAP body:
message {http://www.icrm.org/test/}process element
{http://www.icrm.org/test/}CalcServiceProcessRequest.&#xd;
        at
org.apache.ode.axis2.util.SoapMessageConverter.extractSoapBodyParts(SoapMessageConverter.java:384)&#xd;
        at
org.apache.ode.axis2.util.SoapMessageConverter.parseSoapRequest(SoapMessageConverter.java:306)&#xd;
        at
org.apache.ode.axis2.ODEService.onAxisMessageExchange(ODEService.java:109)&#xd;
        ... 20 more&#xd;
Caused by: java.lang.IllegalArgumentException: Unexpected element in SOAP
body: message {http://www.icrm.org/test/}process element
{http://www.icrm.org/test/}CalcServiceProcessRequest.&#xd;
        at
org.apache.ode.utils.wsdl.Messages.msgUnexpectedElementInSOAPBody(Messages.java:134)&#xd;
        ... 23 more&#xd;
</Exception></detail></soapenv:Fault>

        <!--
                CalcServiceProcess BPEL Process [Generated by the Eclipse BPEL
                Designer]
        -->
<bpel:process name="CalcServiceProcess"
targetNamespace="http://www.icrm.org/test/";
        suppressJoinFailure="yes" xmlns:tns="http://www.icrm.org/test/";
        xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable";>

    <!-- Import the client WSDL -->
        <bpel:import namespace="http://www.icrm.org/test/";
                location="CalcServiceProcessArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/";></bpel:import>
        <!--
                
=================================================================
        -->
        <!--
                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:CalcServiceProcess"
                        partnerRole="CalcServiceProcessProvider"
myRole="CalcServiceProcessProvider" />
                <bpel:partnerLink name="AddService" 
partnerLinkType="tns:AddService"
                        partnerRole="AddServiceProvider"></bpel:partnerLink>
                <bpel:partnerLink name="SubService" 
partnerLinkType="tns:SubService"
                        partnerRole="SubServiceProvider"></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:CalcServiceProcessRequestMessage">
                </bpel:variable>
                <!--
                        Reference to the message that will be returned to the 
requester
                -->
                <bpel:variable name="output"
                        messageType="tns:CalcServiceProcessResponseMessage" />
                <bpel:variable name="inputForAdd"
messageType="tns:addRequest"></bpel:variable>
                <bpel:variable name="inputForSub"
messageType="tns:subRequest"></bpel:variable>
                <bpel:variable name="outputForAdd"
messageType="tns:addResponse"></bpel:variable>
                <bpel:variable name="outputForSub"
messageType="tns:subResponse"></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
                        CalcServiceProcess.wsdl
                -->
                <bpel:receive name="receiveInput" partnerLink="client"
                        createInstance="yes" operation="process"
portType="tns:CalcServiceProcess"
                        variable="input" />
    
        <!-- Generate reply to synchronous request -->
                <bpel:if name="IfAdd">
                
<bpel:condition><![CDATA[$input.payload/tns:type='add']]></bpel:condition>
                        <bpel:sequence>
                                <bpel:assign validate="yes" name="AssignIn">
                                        <bpel:copy ignoreMissingFromData="yes">
                                                <bpel:from>
                                                        <bpel:literal 
xml:space="preserve"><tns:params
                                                                
xmlns:tns="http://www.icrm.org/test/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <left></left>
  <right></right>
</tns:params>
</bpel:literal>
                                                </bpel:from>
                                                <bpel:to variable="inputForAdd" 
part="params"></bpel:to>
                                        </bpel:copy>
                                        <bpel:copy ignoreMissingFromData="yes">
                                                <bpel:from part="payload" 
variable="input">
                                                        <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:left]]></bpel:query>
                                                </bpel:from>
                                                <bpel:to part="params" 
variable="inputForAdd">
                                                        <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:OperNums/left]]></bpel:query>
                                                </bpel:to>
                                        </bpel:copy>
                                        <bpel:copy ignoreMissingFromData="yes">
                                                <bpel:from part="payload" 
variable="input">
                                                        <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:right]]></bpel:query>
                                                </bpel:from>
                                                <bpel:to part="params" 
variable="inputForAdd">
                                                        <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:OperNums/right]]></bpel:query>
                                                </bpel:to>
                                        </bpel:copy>
                                </bpel:assign>
                                <bpel:invoke name="InvokeAdd" 
partnerLink="AddService"
                                        operation="add" 
portType="tns:AddService" inputVariable="inputForAdd"
                                        
outputVariable="outputForAdd"></bpel:invoke>
                                <bpel:assign validate="no" name="AssignOut">
                                        <bpel:copy ignoreMissingFromData="yes">
                                                <bpel:from>
                                                        <bpel:literal 
xml:space="preserve">
                                                        
<tns:CalcServiceProcessResponse
                                                                
xmlns:tns="http://www.icrm.org/test/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <tns:result></tns:result>
</tns:CalcServiceProcessResponse>
</bpel:literal>
                                                </bpel:from>
                                                <bpel:to variable="output" 
part="payload"></bpel:to>
                                        </bpel:copy>
                                        <bpel:copy ignoreMissingFromData="yes">
                                                <bpel:from>
                            
                            
                            
                            <![CDATA[$outputForAdd.result/res]]>
                                                </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:sequence>
                        <bpel:else>
                                <bpel:sequence name="Sequence">
                                        <bpel:assign validate="no" 
name="AssignIn">
                                                <bpel:copy>
                                                        <bpel:from>
                                                                <bpel:literal 
xml:space="preserve"><tns:params
                                                                        
xmlns:tns="http://www.icrm.org/test/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <left></left>
  <right></right>
</tns:params>
</bpel:literal>
                                                        </bpel:from>
                                                        <bpel:to 
variable="inputForSub" part="params"></bpel:to>
                                                </bpel:copy>
                                                <bpel:copy>
                                                        <bpel:from 
part="payload" variable="input">
                                                                <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:left]]></bpel:query>
                                                        </bpel:from>
                                                        <bpel:to part="params" 
variable="inputForSub">
                                                                <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[left]]></bpel:query>
                                                        </bpel:to>
                                                </bpel:copy>
                                                <bpel:copy>
                                                        <bpel:from 
part="payload" variable="input">
                                                                <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:right]]></bpel:query>
                                                        </bpel:from>
                                                        <bpel:to part="params" 
variable="inputForSub">
                                                                <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[right]]></bpel:query>
                                                        </bpel:to>
                                                </bpel:copy>
                                        </bpel:assign>
                                        <bpel:invoke name="InvokeSub" 
partnerLink="SubService"
                                                operation="sub" 
portType="tns:SubService" inputVariable="inputForSub"
                                                
outputVariable="outputForSub"></bpel:invoke>
                                        <bpel:assign validate="no" 
name="AssignOut">
                                                <bpel:copy>
                                                        <bpel:from>
                                                                <bpel:literal 
xml:space="preserve"><tns:CalcServiceProcessResponse
                                                                        
xmlns:tns="http://www.icrm.org/test/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <tns:result></tns:result>
</tns:CalcServiceProcessResponse>
</bpel:literal>
                                                        </bpel:from>
                                                        <bpel:to 
variable="output" part="payload"></bpel:to>
                                                </bpel:copy>
                                                <bpel:copy>
                                                        <bpel:from>
                                
                                
                                <![CDATA[$outputForSub.result/res]]>
                                                        </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:sequence>
                        </bpel:else>
                </bpel:if>
                <bpel:reply name="replyOutput" partnerLink="client"
                        operation="process" portType="tns:CalcServiceProcess" 
variable="output"
/>
        </bpel:sequence>
</bpel:process>


Dhanush Gopinath wrote:
> 
> You probably can write a SOAP Client in Java which can send a SOAP
> request to the WS endpoint opened up by your BPEL process. Have a look
> at the javax.xml.ws package.
> 
> How ever the error you mentioned below is probably due the wrong
> initialization of variables. selectionFailure typically comes when ODE
> is not able to select the exact xml element in an assign. Please look in
> the log and see which element is not properly initialized. 
> 
> Dhanush 
> 
> -----Original Message-----
> From: LeeMike [mailto:[email protected]] 
> Sent: Sunday, May 30, 2010 2:34 PM
> To: [email protected]
> Subject: How can invoke eclipse bpel process from java Applications
> 
> 
> 
> 
> I deploy a simple BPEL process which implemented Add or subtract on
> Apache
> ODE .The path of WSDL which described BPEL process is
> "http://localhost:8080/ode/processes/CalcServicePort?wsdl"; . 
> I test this BPEL process through web services Explorer which is
> myeclipse
> plugin, this test is successful.
> But I want to invoke this BPEL process from java Applications .So I try
> to
> invoke this web service through
> org.codehaus.xfire.client.Client.Invoke(),but this test is failure,i
> meet an
> error which is "selectionFailure".
> How can invoke this web service on java Applications as  general web
> services .
> thanks!
> 
> the content of wsdl  :
> <schema xmlns="http://www.w3.org/2001/XMLSchema";
> xmlns:wsdl="http://ode/bpel/unit-test.wsdl";
> attributeFormDefault="unqualified" elementFormDefault="qualified"
> targetNamespace="http://www.icrm.org/test/";>
> <complexType name="CalcServiceProcessRequest">
>  <sequence>
>   <element name="type" type="string" /> 
>   <element name="left" type="int" /> 
>   <element name="right" type="int" /> 
>   </sequence>
>   </complexType>
>  <complexType name="CalcServiceProcessResponse">
>  <sequence>
>   <element name="result" type="int" /> 
>   </sequence>
>   </complexType>
>   <element name="CalcServiceProcessRequest"
> type="tns:CalcServiceProcessRequest" /> 
>   <element name="CalcServiceProcessResponse"
> type="tns:CalcServiceProcessResponse" /> 
>   </schema>
>  <wsdl:message name="CalcServiceProcessRequestMessage">
>   <wsdl:part name="payload" element="tns:CalcServiceProcessRequest" /> 
>   </wsdl:message>
>  <wsdl:message name="CalcServiceProcessResponseMessage">
>   <wsdl:part name="payload" element="tns:CalcServiceProcessResponse" /> 
>   </wsdl:message>
>  <wsdl:portType name="CalcServicePortPortType">
>  <wsdl:operation name="process">
>   <wsdl:input message="tns:CalcServiceProcessRequestMessage"
> wsaw:Action="http://www.icrm.org/test/process"; /> 
>   <wsdl:output message="tns:CalcServiceProcessResponseMessage"
> wsaw:Action="http://www.icrm.org/test/CalcServiceProcess/processResponse
> " /> 
>   </wsdl:operation>
>   </wsdl:portType>
>  <wsdl:binding name="CalcServicePortSOAP11Binding"
> type="tns:CalcServicePortPortType">
>   <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
> style="document" /> 
>  <wsdl:operation name="process">
>   <soap:operation soapAction="http://www.icrm.org/test/process";
> style="document" /> 
> <wsdl:input>
>   <soap:body use="literal" /> 
>   </wsdl:input>
> <wsdl:output>
>   <soap:body use="literal" /> 
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
> <wsdl:binding name="CalcServicePortSOAP12Binding"
> type="tns:CalcServicePortPortType">
>   <soap12:binding transport="http://schemas.xmlsoap.org/soap/http";
> style="document" /> 
> <wsdl:operation name="process">
>   <soap12:operation soapAction="http://www.icrm.org/test/process";
> style="document" /> 
> <wsdl:input>
>   <soap12:body use="literal" /> 
>   </wsdl:input>
>  <wsdl:output>
>   <soap12:body use="literal" /> 
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
> <wsdl:binding name="CalcServicePortHttpBinding"
> type="tns:CalcServicePortPortType">
>   <http:binding verb="POST" /> 
> <wsdl:operation name="process">
>   <http:operation location="CalcServicePort/process" /> 
>  <wsdl:input>
>   <mime:content type="text/xml" part="process" /> 
>   </wsdl:input>
> <wsdl:output>
>   <mime:content type="text/xml" part="process" /> 
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
>  <wsdl:service name="CalcServicePort">
>  <wsdl:port name="CalcServicePortSOAP11port_http"
> binding="tns:CalcServicePortSOAP11Binding">
>   <soap:address
> location="http://localhost:8080/ode/processes/CalcServicePort"; /> 
>   </wsdl:port>
>  <wsdl:port name="CalcServicePortSOAP12port_http"
> binding="tns:CalcServicePortSOAP12Binding">
>   <soap12:address
> location="http://localhost:8080/ode/processes/CalcServicePort"; /> 
>   </wsdl:port>
>  <wsdl:port name="CalcServicePortHttpport"
> binding="tns:CalcServicePortHttpBinding">
>   <http:address
> location="http://localhost:8080/ode/processes/CalcServicePort"; /> 
>   </wsdl:port>
>   </wsdl:service>
> 
> 
> -- 
> View this message in context:
> http://old.nabble.com/How-can-invoke-eclipse-bpel-process-from-java-Appl
> ications-tp28720897p28720897.html
> Sent from the Apache Ode User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-can-invoke-eclipse-bpel-process-from-java-Applications-tp28720897p28730571.html
Sent from the Apache Ode User mailing list archive at Nabble.com.

Reply via email to