Topic
6 replies Latest Post - ‏2013-05-10T14:53:40Z by Simmer77
Simmer77
Simmer77
55 Posts
ACCEPTED ANSWER

Pinned topic Asynchronous Schema validation in MPGW

‏2013-05-08T22:08:58Z |

Hi,

We have a requirement to asynchronously  validate the request (schema validation) and  route the request to the web service()  and send a synchronous  acknowledgement to the client without bothering about the result of schema validation and web service call.

We implemented this scenario by taking an asynchronous transform action and doing the validation and web service call in the same XSLT and it was working fine. 

Now  the  issue is we need to validate some number of fields as a part of request validation(which will be very complicated in the XSLT). 

So we decided to use a validate action and a schema file to validate and send an error message to different service in asynchronous mode , but no error is being called as it is async. and also we need a web service call also as next transform in async mode  which is creating issues.

I explored the option of even sync action, but it didnt helped.

As i guess we cannot use two async actions back to back (like one's output as input to other).

Please share you valuable thoughts on this and please correct me if i am wrong in my approach.

My flow will be     req -> validate (async)->webservice call(async) -> acknowledgement msg to client (sync) ->

and send an error to another service (if schema validation ocurs

Please provide you expertise.

 

Updated on 2013-05-08T22:10:39Z at 2013-05-08T22:10:39Z by Simmer77
  • Hemchan
    Hemchan
    19 Posts
    ACCEPTED ANSWER

    Re: Asynchronous Schema validation in MPGW

    ‏2013-05-09T04:33:14Z  in response to Simmer77

    Create a separate request rule for schema validation and web service call, make this rule as reusable rule and call it using Call-Processing action(async) in the actual processing rule. In this case schema validation and web service call totally become async. 

    Please let me know if this flow helps you.

     

     

    • Simmer77
      Simmer77
      55 Posts
      ACCEPTED ANSWER

      Re: Asynchronous Schema validation in MPGW

      ‏2013-05-09T21:50:09Z  in response to Hemchan

      Hemchan,

      Thanks for replying. Yes the flow will work, but issue is in case of schema validation error , i need to send the error to another webservice.

      I tried that by putting an on error action in the same rule (which i am calling using call processing action). but its not getting called.

      Any suggestions for this.

       

      • Hemchan
        Hemchan
        19 Posts
        ACCEPTED ANSWER

        Re: Asynchronous Schema validation in MPGW

        ‏2013-05-10T05:50:59Z  in response to Simmer77

        Der11,

        Please ensure the steps below are there in your policy.

        1.Create a separate error rule which calls the web service(in case of schema validation).

        2. Put on-error action(mode: alternate, processing rule : 'error rule you created in previous step') before the validation action in the rule which is called using call processing action.

        Hope this work. 

        Regards,

        Hemchan

        • Simmer77
          Simmer77
          55 Posts
          ACCEPTED ANSWER

          Re: Asynchronous Schema validation in MPGW

          ‏2013-05-10T06:37:12Z  in response to Hemchan

          Hemchan,

          <(mode: alternate, processing rule : 'error rule you created in previous step') before the validation action >

          I already tried this on error action but after the validation action, it didnt worked. I do not understand the significance of putting on error before validation.

          Please correct me if i am wrong.

          • Hemchan
            Hemchan
            19 Posts
            ACCEPTED ANSWER

            Re: Asynchronous Schema validation in MPGW

            ‏2013-05-10T07:06:36Z  in response to Simmer77

            On Error action will take control of errors that occur after it got processed. Here in your scenario, validation action failed and the next action(on-error) will not get executed. Hope this clarifies.

             

            Hemchan

            • Simmer77
              Simmer77
              55 Posts
              ACCEPTED ANSWER

              Re: Asynchronous Schema validation in MPGW

              ‏2013-05-10T14:53:40Z  in response to Hemchan

              Hemchan,

              Thanks a lot for your expertise.