4 Replies Latest reply on Oct 21, 2009 5:06 AM by Yaw Tee Lim

    Error handling consuming Web Services by external apps

      Share This:

      Hi all,

       

      In the event of a failure, is there a way send a more precise and descriptive message when an external apps call a web service published from the AR System?

       

      Thanks.

       

      Regards,

      Yaw Tee

        • 1. Re: Error handling consuming Web Services by external apps
          Sylvain YVON

          Hi Yaw Tee,

           

          Can you give more details about your webservice, and in which case it doesn't provide enough informations ?

          AFAK, the errors related to the webservice itself (xml structure, missing required fields, ...) are handled by Axis.

          All purely applicative errors (arerr, arwarn, arnote) are handled by ARS. You can add any level of complexity to the reply sent by ARS by enabling error handling in your interface form for example.

           

          Regards,

          Sylvain

          • 2. Re: Error handling consuming Web Services by external apps

            Hi Sylvain,

             

            Thanks for replying.

             

            I am basically looking at how I could add reply from ARS specically related to insufficient inputs, validation related errors etc when the web service is called.  Where do I do that in ARS?  You guidance would be most appreciated.

             

            Thanks.

             

            Regards,

            Yaw Tee

            • 3. Re: Error handling consuming Web Services by external apps
              Sylvain YVON

              Yaw Tee,

               

              The included help of the admin tool will provide you with some good starting informations regarding how webservices published via ARS work with null or absent values. In the index, search for XML / Simple editing and then Handling null, empty, and missing values.

              When you have read that, if you want to put all your field tests workflow in ARS instead of letting Axis handle it, you can edit the definition of your webservice and switch most of your fields "MinOccurs" to 0 and nillable=true. Now you need to add a field in your output mapping, that will hold an error message.

              Here is an example of a set of filter actions that could fire when an entry is submitted via your webservice to meet your needs :

              - if field1 is null or invalid

                   set error field to "error, field1 is null or invalid"

                   go to exit

              - if field2 is null or invalid

                   [...]

               

              - push fields to form2

                   error handling => set error field to "error, " + $ERRCODE$ + " - " + $ERRMSG$ + [...]

              - [...]

               

              - exit

               

              hth

              Sylvain

               

              PS: Error handling is for versions 7.1+ of ARS

              • 4. Re: Error handling consuming Web Services by external apps

                Thanks Sylvain.  This is most helpful.