1 2 Previous Next 15 Replies Latest reply on Aug 10, 2005 1:22 AM by anil.saldhana

    Web Services for jBPM (cnt'd)

    kukeltje

      Lets continue the WS discussion from https://sourceforge.net/forum/message.php?msg_id=3270272 here if needed.

      Ronald

        • 1. Re: Web Services for jBPM (cnt'd)
          tom.baeyens

          what libraries and set up do you need to add a web service invocation based on SAAJ to jbpm ?

          same question for web service production.

          how do you plan integrating this in the jbpm.3 project ? (i want the least number of dependencies and if possible a simple set up via the existing jboss configuration scripts)

          regards, tom.

          • 2. Re: Web Services for jBPM (cnt'd)
            aguizar

            Consumption

            Libraries: The only library required at compile time is saaj.jar. Runtime requirements vary depending on the actual SAAJ implementation. JBossWS requires the following libraries:
            -axis-ws4ee.jar (JBossWS Axis base)
            -jboss-ws4ee-client.jar (JBossWS additions to Axis)
            -jboss-common-client.jar (JBoss Logger and other stuff)
            -jaxrpc.jar (Axis dependency)
            -activation.jar (SOAP Attachments use the JavaBeans activation framework)
            -commons-discovery.jar (Axis dependency)
            -jbosssx-client.jar (JBossWS dependency)
            -commons-logging.jar (commons-discovery dependency)

            Setup: Set the values of the ?javax.xml.soap.MessageFactory? and ?javax.xml.soap.SOAPConnectionFactory? system properties to the fully qualified names of the factory classes in your SAAJ implementation.

            Production
            SAAJ does not define a server programming model; JAX-RPC/WS4EE does. JAX-RPC lets you work at the SOAP message level through the handler mechanism. The compile time dependencies are jaxrpc.jar and saaj.jar; runtime dependencies are irrelevant as this code runs inside the app server.

            Inclusion in the project
            Considering that most dependencies are specific to the implementation, we can add saaj.jar to the jbpm.3 classpath (jaxrpc.jar will be needed later for production) and develop the invoker in a new package (org.jbpm.webservices?). The implementation libraries are still needed for testing, so we can put them somewhere in the project outside of the class path and use a particular runtime configuration for these tests that includes those libraries.

            • 3. Re: Web Services for jBPM (cnt'd)
              anil.saldhana

              Alejandro,

              a suggestion is to look at the new deployment model, JBossWS team is working on. Use of JSR181 annotations which simplifies the development model. We do have preview release available for it. The use of annotations greatly helps JBoss Web Services for ejb3 deployment.

              Doing Saaj programming will bring limited dependencies, but you will be doing all the work of creating soap messages on one end and parsing and dispatching on the other end. This work is better handled by the Jax-WS (Jax-rpc formerly) mechanism.

              I do not know the details of jbpm3 requirements. Hence if I have spoken with the wrong requirements, I apologize.

              Just some suggestions.

              Anil

              • 4. Re: Web Services for jBPM (cnt'd)
                tom.baeyens

                i definitely think that alex should look at the JBossWS new deployment model.

                But i have 2 questions with the directions you point us to:

                1) JAX-WS (jax-rpc) is afaik, targetted to rpc-style web services and i hear from thomas and other sources that the industry is moving towards document style web services. isn't there a mismatch ? is jax-ws suited for document style web services ? is there another java api for that ?

                2) in jbpm we need to do dynamic runtime invocation of web services. basically a jbpm process needs to configure a webservice invocation at runtime. rpc-stub generation does not fit very well with this needs, right ?

                regards, tom.

                • 5. Re: Web Services for jBPM (cnt'd)
                  kukeltje

                   

                  "tom.baeyens@jboss.com" wrote:

                  2) in jbpm we need to do dynamic runtime invocation of web services. basically a jbpm process needs to configure a webservice invocation at runtime. rpc-stub generation does not fit very well with this needs, right ?
                  regards, tom.


                  Yes, that is my opinion to. Maybe WSIF from apache can help out a little, but I think we can for an initial release easily do without.



                  • 6. Re: Web Services for jBPM (cnt'd)
                    aguizar

                    Anil, thanks for your suggestions! The timing was excellent as we're about to start the implementation of service invocation. I spent some time reading the public review draft of the JAX-WS 2.0 specification, so I'm now able to expand Tom's questions :-)

                    Referred as "a follow-on to JAX-RPC 1.1" (1), the name change reflects the new direction of this technology. Among other goals, "JAX-WS 2.0 will improve support for document/message centric usage" (2).

                    The client deployment model defined in WS4EE did not address standalone (JSE) clients, as opposed to application (JEE) clients. On the other hand, JAX-WS will be prepared for inclusion in a future version of JSE and "will define mechanisms to produce fully portable clients".

                    JAX-RPC defined its own data binding facilities, but it did not define a way to turn them off. Conversely, "JAX-WS describes the WSDL<->Java mapping, but data binding is delegated to JAXB" (3).

                    JAX-RPC spared a programmer the details of converting between Java method invocations and the corresponding XML messages. In some cases, tough, operating at the XML message level is desirable. Under JAX-RPC the only way to do it was indirectly via handlers. In JAX-WS, "the Dispatch interface provides support for this mode of interaction" (4).

                    Dispatch supports two usages: 'Message' and 'Message Payload'. In the latter, a client application would work with the contents of the SOAP Body rather than the SOAP message as a whole. We would like this usage for jBPM as the framework still deals with overall message assembly/disassembly.

                    JAX-WS provides the features we traded off from JAX-RPC (optional WSDL support, pluggable message handlers), presents a modular design and still lets us work at the message level. I still have not taken a look at the deployment model; will do asap. Annotations, while making web services in java as easy to code as in .net, are not useful as stated earlier. I will be more interested in the model if there something in the direction of "fully portable clients".

                    References
                    The Java API for XML Web Services 2.0: http://jcp.org/en/jsr/detail?id=224
                    (1) Introduction
                    (2) Section 1.1
                    (3) Section 1.3.1
                    (3) Section 4.4

                    • 7. Re: Web Services for jBPM (cnt'd)
                      anil.saldhana

                      * AFAIK, WSIF is a dead project.
                      * JaxWS is about interoperable webservices. The stress will be on document style web services. There will be support for rpc/literal style too.
                      * Beauty of Jax-WS will be annotating your endpoint implementation with JSR181 annotations and the container will take care of the deployment.

                      As I said earlier, I was merely suggesting.

                      Dynamic configuration should be possible.

                      Unless I know more about the requirements of jBPM project, I cannot say more.

                      • 8. Re: Web Services for jBPM (cnt'd)
                        kukeltje

                         

                        "anil.saldhana@jboss.com" wrote:
                        * AFAIK, WSIF is a dead project.


                        Sure? Oracle seems to rely heavily on it in their BPEL implementation to achieve optimization so e.g. ejb's or pojo's can be called from bpel without making a real webservice. But hey, if they want to bet on a dead horse.


                        • 9. Re: Web Services for jBPM (cnt'd)
                          anil.saldhana

                          AFAIK, WSIF allows you to create an Invocation object while passing a wsdl file. When the whole standardized webservices paradigm in J2EE provides you this capability, use it. :-)

                          • 10. Re: Web Services for jBPM (cnt'd)
                            aguizar

                            Anil,

                            The jBPM web service consumption requirements are summarized in the following jBPM process action, which describes an RPC invocation:

                            <ws-invoke endpoint="anyURI" operation="math:add" xmlns:math='urn:example:math'>
                             <input location="firstNumber">var1</input>
                             <input location="secondNumber>var2</input>
                             <output location="result">result</output>
                            </ws-invoke>

                            - 'math:add' is the qualified name of the RPC operation element.
                            - Attribute 'location' specifies a (XPath) location path relative to the operation element.
                            - The content of each 'input' element is an expression whose value is assigned to the specified location in the input message. Note, the value must be either a primitive type or a DOM element; XML<->data binding must be explicitly performed by the user.
                            - The content of each 'output' element identifies a location that receives the value of the specified location in the output message.

                            A request SOAP envelope we would expect to see is:
                            <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
                             <S:Body>
                             <math:add xmlns:math="urn:example:math">
                             <firstNumber>20</firstNumber>
                             <secondNumber>45</secondNumber>
                             </math:add>
                             </S:Body>
                            </S:Envelope>

                            A possible response SOAP envelope is:
                            <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/";>
                             <S:Body>
                             <math:addResponse xmlns:math="urn:example:math">
                             <result>65</result>
                             </math:addResponse>
                             </S:Body>
                            </S:Envelope>


                            Do you think we can build a portable JAX-WS client that implements this design with the current features of JBossWS?

                            • 11. Re: Web Services for jBPM (cnt'd)
                              bonfarj

                              i didn't understand... can jBPM invoke web services or not? if it can, how? if it can't, what i need to do?

                              i'm using jBPM 3

                              thanks my friends ;)

                              • 12. Re: Web Services for jBPM (cnt'd)
                                tom.baeyens

                                not yet.

                                implement an ActionHandler to invoke your webservice with a Java API of your choice.

                                regards, tom.

                                • 13. Re: Web Services for jBPM (cnt'd)
                                  eruiz

                                  Hi all,

                                  I have found this article: https://bpcatalog.dev.java.net/nonav/soa/standalone-client/, I'm not a WS expert and I don't know if the ideas that the article presents can be applied to this discussion. IMHO it satisfies Tom's requirements.

                                  I hope this article can be useful.

                                  • 14. Re: Web Services for jBPM (cnt'd)
                                    aguizar

                                    Thanks for the pointer. I'll take a look at it.

                                    1 2 Previous Next