7 Replies Latest reply on Apr 10, 2009 12:47 PM by Jeff DeLong

    newbie - contract first webservice

    Gautam Zalpuri Newbie


      Need some assistance with setting up a contract first webservice. Is it possible to do this in JBossESB with no java code (just the wsdl)?

      I saw the quickstarts - the publish_as_webservice appears to be something related. However, it doesn't seem to use a wsdl (?) Is there another quickstart I should be looking at?

      Any tips/ pointers are appreciated.


        • 1. Re: newbie - contract first webservice
          Jeff DeLong Master

          Define your "contract" in your message schema definition (request.xsd, etc.). Then define the service as in publish_as_webservice quickstart, using the actions element to reference your xsds. As part of deployment, a wsdl will be automatically generated and placed in server/default/data/wsdl that defines a single generic operation. Your client can then use that wsdl to consume the service.

          • 2. Re: newbie - contract first webservice
            Gautam Zalpuri Newbie

            Thank you for the quick response.

            The wsdl has many operations based on several schemas. Does this mean that for each operation in the wsdl there will be a separate webservice/ wsdl generated? Is it possible to generate the webservice purely from the wsdl?

            We're actually trying to move from Mule to JBossESB - and it would be good to reuse the wsdl's already defined without a lot of change.


            • 3. Re: newbie - contract first webservice
              Jeff DeLong Master

              I would look at your schemas and wsdls and determine if you have currently defined as single service really is a separate service or whether you should really expose multiple services with fewer capabilities. At that point I would define a message schema that includes the name of the capability (or task) to be performed by the service as part of the message data, and vary the elements within the schema based on the capability or task. In this way the operation becomes somewhat generic, and the real contract is in the message schema. Then create ESB actions that use the capability/task name to perform the actual work (or proxy some other service that does the real work).

              This results in a more extensible, flexible design.

              JBossESB does not expose an ESB service as a Web service from an existing wsdl; it generates a Web service from the input/output/fault xsds.

              • 4. Re: newbie - contract first webservice
                Gautam Zalpuri Newbie

                I'm currently using a blend of hr-xml standard and custom schemas in the wsdl and several operations. The service is definitely a single logical service with multiple operations. Interesting suggestion about making the capability a part of the message - this is a possible workaround and provides some food for thought. Thank you.

                To provide some context - we're trying to use the ESB as a connector between two webservices - ours and vendors (to enable use of a canonical data model within the org. rather than relying on muliple vendor specific schemas)

                One of the directions I'm leaning towards is a non-ESB webservice as the ESB client; the non-ESB webservice hosts the canonical model, and, the ESB does the schema conversion (to/from the external webservices), and handles communication with the external (vendor) services. The advantage this has is it allows reusing the existing wsdl (contract). Would JBoss ESB support this model (sorry - I'm trying to skip reading through the manuals and get a running start on this)


                • 5. Re: newbie - contract first webservice
                  Jeff DeLong Master

                  Yes, you can define an ESB Service (exposed as web service or through some other gateway, e.g, JMS) that does a conversion from your canonical data model to the vendor data model and invokes the vendor web service.

                  • 6. Re: newbie - contract first webservice
                    Gautam Zalpuri Newbie

                    thanks. i put together a basic webservice as the gateway. now for the gateway to talk to the esb, is there a way that is recommended (or is better than others)?

                    thanks in advance.

                    • 7. Re: newbie - contract first webservice
                      Jeff DeLong Master

                      Have your gateway talk directly to the ESB using the ServiceInvoker API. For example, see samples/quickstarts/native_client/war/src/org/jboss/soa/esb/samples/quickstart/nativeclient/webservice .