Forum Discussion

jaxwsattest's avatar
jaxwsattest
New Contributor
10 years ago

How to handle transaction management while invoking webservice?

We are trying to invoke a JAX-WS webservice through SOAP UI and we are successful with the same. But during the process, if something fails, the SOAP UI does a partial commit meaning it does not do a rollback but instead it does a commit.

I need to know how to handle the transaction management. Mainly on how to do a rollback when something fails.

3 Replies

  • Hi,

     

    I'm not sure which transactions you are talking about. Are you talking about transactions within your web service?

    Can you try to elaborate a little bit about what you are trying to achieve?

     

    Regards,

    Anders

    Ready! API developer

    • jaxwsattest's avatar
      jaxwsattest
      New Contributor

      Thanks Anders.

       

      Sorry for the delay. We are using JAX-WS WebService with Atomic Transaction (SUPPORTS type) which in turn uses  User Transaction on it as like below,

      UserTransaction tx = null;
              try {
                  ctx = new InitialContext();
                  tx = (UserTransaction)ctx.lookup("javax.transaction.UserTransaction");

      The WebService has been deployed successfully on WebLogic 12c server. Now, i am invoking this WebService through SOAP UI tool which in turn calls the WebService correctly.

      The issue happens only when something fails in middle of business logic. The SOAP UI returns the error that is returned from business logic but the business logic process which happened before the failure gets committed. (PARTIAL COMMIT).

      So, I need to find the way to rollback the changes through SOAP UI when the API errors.

      • AJaensson's avatar
        AJaensson
        Icon for Staff rankStaff

        Still not sure if I fully understand the problem.

        SoapUI acts as a client to your API. It is never the clients responsibility to rollback transactions on the server if something fails in the business logic.

        I advice you to look at how you handle transactions in the web service, as something seems to be wrong there.

         

        Regards,

        Anders

        Ready! API developer