Hi Seetha,

You could add the following in-sequence to your API, it will return error
response to the user, if header is not present:

<sequence xmlns="http://ws.apache.org/ns/synapse"; name="sequence">
   <property name="BusinessTransID" expression="$trp:BusinessTransID" />
   <filter source="boolean(get-property('BusinessTransID'))" regex="false">
      <then>
         <payloadFactory media-type="json">
            <!-- Flow if not exists -->
            <format>{ "Error": "Missing header - BusinessTransID "}</format>
            <args/>
         </payloadFactory>
         <respond/>
      </then>
         <else>
            <!-- Flow if exists -->
         </else>
   </filter>
</sequence>

Thanks,
Vithursa

On Thu, Nov 7, 2019 at 2:02 PM seetha1 <[email protected]> wrote:

> HI all ,
>        how do i validate customer headers , i have to throw exception if an
> header is empty.
> e.g - BusinessTransID.
>
> regards,
> seetha
>
>
>
> --
> Sent from:
> http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
*Vithursa Mahendrarajah* | Senior Software Engineer | WSO2 Inc
(m) +94 766 695 643 | (e) [email protected]

* <http://wso2.com/signature>[image: https://wso2.com/signature]
<https://wso2.com/signature>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to