2017-11-13 4 views
0

Ich bin neu in BPEL und kämpfe um loszulegen.Apache ODE BPEL soapenv: Server axis2ns1: selectionFailure

habe ich eine einfache If/Else-Workflow, aber die folgende Fehlermeldung erhalten, wenn ich die WSDL-Datei mit Eclipse Web-Services-Explorer mich entschieden:

soapenv:Server axis2ns1:selectionFailure 

Mein Verständnis von anderen ähnlichen Fragen ist es wahrscheinlich etwas sehr einfach und im Zusammenhang mit dem Namespace oder Variablennamen in der if-Bedingung, aber ich kann nicht verstehen warum und wie man es löst.

Ich verwende Apache ODE 1.3.7 auf Eclipse 4.7.1 Oxygen und Tomcat 8.5.

Das ist mein Workflow-Design:

workflow design

BPEL-Datei:

<!-- Flow1 BPEL Process [Generated by the Eclipse BPEL Designer] --> 
<!-- Date: Mon Nov 13 23:18:38 AST 2017 --> 
<bpel:process name="Flow1" 
     targetNamespace="http://Flow1" 
     suppressJoinFailure="yes" 
     xmlns:tns="http://Flow1" 
     xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" 
     > 

    <!-- Import the client WSDL --> 
    <bpel:import location="Flow1Artifacts.wsdl" namespace="http://Flow1" 
      importType="http://schemas.xmlsoap.org/wsdl/" /> 

    <!-- ================================================================= -->   
    <!-- 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:Flow1" 
        myRole="Flow1Provider" 
        /> 
    </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:Flow1RequestMessage"/> 

     <!-- 
      Reference to the message that will be returned to the requester 
      --> 
     <bpel:variable name="output" 
        messageType="tns:Flow1ResponseMessage"/> 
    </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 Flow1.wsdl 
      --> 
     <bpel:receive name="receiveInput" partnerLink="client" 
       portType="tns:Flow1" 
       operation="process" variable="input" 
       createInstance="yes"/> 

     <!-- Generate reply to synchronous request --> 



     <bpel:if name="If"> 
      <bpel:condition expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[$input.payload/tns:input="John"]]></bpel:condition> 
     <bpel:sequence name="Sequence"> 
       <bpel:assign validate="no" name="Assign"> 
        <bpel:copy> 
         <bpel:from> 
          <bpel:literal xml:space="preserve">Hi John</bpel:literal> 
         </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:reply name="replyOutput" partnerLink="client" portType="tns:Flow1" operation="process" variable="output" /> 

      </bpel:sequence> 
      <bpel:else> 
       <bpel:sequence name="Sequence1"> 
        <bpel:assign validate="no" name="Assign1"> 
         <bpel:copy> 
          <bpel:from> 
           <bpel:literal xml:space="preserve">Not john</bpel:literal> 
          </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:reply name="Reply" partnerLink="client" operation="process" portType="tns:Flow1" variable="output"></bpel:reply> 
       </bpel:sequence> 
      </bpel:else> 

     </bpel:if> 
    </bpel:sequence> 
</bpel:process> 

WSDL-Datei:

<?xml version="1.0"?> 
<definitions name="Flow1" 
     targetNamespace="http://Flow1" 
     xmlns:tns="http://Flow1" 
     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="http://Flow1" 
       xmlns="http://www.w3.org/2001/XMLSchema"> 

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

      <element name="Flow1Response"> 
       <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="Flow1RequestMessage"> 
     <part name="payload" element="tns:Flow1Request"/> 
    </message> 
    <message name="Flow1ResponseMessage"> 
     <part name="payload" element="tns:Flow1Response"/> 
    </message> 

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

    <!-- portType implemented by the Flow1 BPEL process --> 
    <portType name="Flow1"> 
     <operation name="process"> 
      <input message="tns:Flow1RequestMessage" /> 
      <output message="tns:Flow1ResponseMessage"/> 
     </operation> 
    </portType> 
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    PARTNER LINK TYPE DEFINITION 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->  
    <plnk:partnerLinkType name="Flow1"> 
     <plnk:role name="Flow1Provider" portType="tns:Flow1"/> 
    </plnk:partnerLinkType> 


<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    BINDING DEFINITION - Defines the message format and protocol details 
    for a web service. 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> 
    <binding name="Flow1Binding" type="tns:Flow1"> 
     <soap:binding style="document" 
      transport="http://schemas.xmlsoap.org/soap/http" /> 
     <operation name="process"> 
      <soap:operation 
       soapAction="http://Flow1/process" /> 
      <input> 
       <soap:body use="literal" /> 
      </input> 
      <output> 
       <soap:body use="literal" /> 
      </output> 
     </operation> 
    </binding> 

<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    SERVICE DEFINITION - A service groups a set of ports into 
    a service unit. 
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> 
    <service name="Flow1Service"> 
     <port name="Flow1Port" binding="tns:Flow1Binding"> 
      <soap:address location="http://localhost:8084/ode/processes/Flow1" /> 
     </port> 
    </service> 
</definitions> 

und Deploy.xml

<?xml version="1.0" encoding="UTF-8"?> 
<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:Flow1="http://Flow1"> 
    <process name="Flow1:Flow1"> 
    <active>true</active> 
    <retired>false</retired> 
    <process-events generate="all"/> 
    <provide partnerLink="client"> 
     <service name="Flow1:Flow1Service" port="Flow1Port"/> 
    </provide> 
    </process> 
</deploy> 

Antwort

1

SelectionFailure gibt an, dass das XML-Element, das abgefragt wird, nicht gefunden wird. Wenn Sie Ihr BPEL betrachten, nehme ich an, dass die Ausgangsvariable abgefragt wird, bevor Sie sie initialisieren.

Initialisieren Sie die Ausgangsgröße vor dem if/else:

<bpel:assign validate="no" name="initialize"> 
    <bpel:copy> 
     <bpel:from> 
      <bpel:literal xml:space="preserve"> 
       <tns:Flow1Response xmlns:tns="http://Flow1"><tns:result /></tns:Flow1Response> 
      </bpel:literal> 
     </bpel:from> 
     <bpel:to part="payload" variable="output" /> 
    </bpel:copy> 
</bpel:assign>