3 Replies Latest reply on May 21, 2008 9:42 AM by gllambi

    BPEL 2.0 examples

    gllambi

      Hi, I've been trying to consume a bpel 2.0 process with jbpm and the following exception occurs. Any idea what's the problem?

      19:08:26,045 ERROR [XPathEvaluator] cannot create node for non-element context n
      ode: [#document: null]
      19:09:25,811 ERROR [[jsp]] Servlet.service() para servlet jsp lanz¾ excepci¾n
      javax.xml.ws.soap.SOAPFaultException: The service is not in an appropiate state
      for the requested operation
       at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SO
      APFaultHelperJAXWS.java:69)
       at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultExceptio
      n(SOAP11BindingJAXWS.java:109)
       at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPB
      inding.java:553)
      


      Here is the bpel process

      <?xml version="1.0" encoding="UTF-8"?>
      <bpws:process exitOnStandardFault="yes" name="HelloProcess"
       suppressJoinFailure="yes"
       targetNamespace="http://eclipse.org/bpel/sample"
       xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:tns="http://eclipse.org/bpel/sample">
       <bpws:import importType="http://schemas.xmlsoap.org/wsdl/"
       location="HelloProcess.wsdl" namespace="http://eclipse.org/bpel/sample"/>
       <bpws:partnerLinks>
       <bpws:partnerLink myRole="HelloProcessProvider" name="client" partnerLinkType="tns:HelloProcess"/>
       </bpws:partnerLinks>
       <bpws:variables>
       <bpws:variable messageType="tns:HelloProcessRequestMessage" name="input"/>
       <bpws:variable messageType="tns:HelloProcessResponseMessage" name="output"/>
       </bpws:variables>
       <bpws:sequence name="main">
       <bpws:receive createInstance="yes" name="receiveInput"
       operation="process" partnerLink="client"
       portType="tns:HelloProcess" variable="input"/>
       <bpws:assign name="Assign" validate="no">
       <bpws:copy>
       <bpws:from>
       <bpws:literal>Hello</bpws:literal>
       </bpws:from>
       <bpws:to part="payload" variable="output">
       <bpws:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[/tns:result]]></bpws:query>
       </bpws:to>
       </bpws:copy>
       </bpws:assign>
       <bpws:reply name="replyOutput" operation="process"
       partnerLink="client" portType="tns:HelloProcess" variable="output"/>
       </bpws:sequence>
      </bpws:process>
      


      And here is the wsdl of the process:

      <?xml version="1.0"?>
      <definitions name="HelloProcess"
       targetNamespace="http://eclipse.org/bpel/sample"
       xmlns:tns="http://eclipse.org/bpel/sample"
       xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       >
      
      <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       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://eclipse.org/bpel/sample"
       xmlns="http://www.w3.org/2001/XMLSchema">
      
       <element name="HelloProcessRequest">
       <complexType>
       <sequence>
       <element name="input" type="string"/>
       </sequence>
       </complexType>
       </element>
      
       <element name="HelloProcessResponse">
       <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="HelloProcessRequestMessage">
       <part name="payload" element="tns:HelloProcessRequest"/>
       </message>
       <message name="HelloProcessResponseMessage">
       <part name="payload" element="tns:HelloProcessResponse"/>
       </message>
      
      <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       PORT TYPE DEFINITION - A port type groups a set of operations into
       a logical service unit.
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
      
       <!-- portType implemented by the HelloProcess BPEL process -->
       <portType name="HelloProcess">
       <operation name="process">
       <input message="tns:HelloProcessRequestMessage" />
       <output message="tns:HelloProcessResponseMessage"/>
       </operation>
       </portType>
      
      
      <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       PARTNER LINK TYPE DEFINITION
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       <plnk:partnerLinkType name="HelloProcess">
       <plnk:role name="HelloProcessProvider" portType="tns:HelloProcess"/>
       </plnk:partnerLinkType>
      
      </definitions>
      


      Thanks!

      Guzman

        • 1. Re: BPEL 2.0 examples
          conoroneill

          Some BPEL 2 stuff definitely works, but the examples supplied are broken. See here for info about getting up-to-date examples.

          http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133268

          • 2. Re: BPEL 2.0 examples
            aguizar

            The query in your process is wrong. The Eclipse BPEL designer has the annoying costume of prepending '/' to queries which should be relative.
            Try one of the following options:

            <bpws:query><![CDATA[tns:result]]></bpws:query>
            or
            <bpws:query><![CDATA[/tns:HelloProcessResponse/tns:result]]></bpws:query>

            Notice the following features:
            * the context node for both queries is the value of the payload part, namely a tns:HelloProcessResponse
            * the first query is relative to the context node; look at the absence of a heading '/'
            * the second query is an absolute traversal from the context node's owner document (also referred as root node); look at the heading '/' and an explicit reference to the element tns:HelloProcessResponse

            • 3. Re: BPEL 2.0 examples
              gllambi

              Yes, it's a bug in the designer. Thank you very much for this detail!

              Regards
              Guzman