Hi All, Requirement: I need to check a condition " Patient ID is the email address of given patient". When I give any string to the ID, it must be an email address. I have to validate ID whether it is in email format. For this, I used the filter mediator in ESB, But I noticed my request didn't go through that filter mediator.
I attached my API configuration in ESB. Please, anyone, help me to validate the email address with ID. <api xmlns="http://ws.apache.org/ns/synapse" name="Durdan" context="/test"> <resource methods="GET" uri-template="/{id}"> <inSequence> <property name="SymboValue" expression="get-property('uri.var.id ')"/> <filter source="get-property('query.param.id')" regex="/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/"> <then> <payloadFactory media-type="xml"> <format> <soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <some>17</some> </soapenv:Header> <soapenv:Body> <ser:readMediData xmlns:ser=" http://service.sample.durdans.com"> <ser:patientId>$1</ser:patientId> </ser:readMediData> </soapenv:Body> </soapenv:Envelope> </format> <args> <arg evaluator="xml" expression="get-property(' uri.var.id')"/> </args> </payloadFactory> <header name="Action" value="urn:readMediDataRecords"/> <property name="SOAPAction" value="urn:readMediData" scope="transport"/> <send> <endpoint> <address uri="Endpoint URL" format="soap11"/> </endpoint> </send> <respond/> <property name="messageType" value="application/soap+xml" scope="axis2" type="STRING"/> </then> <else> <log level="custom"> <property name="Inside the outsequence" value="deefeeeeeeeeeeeeeeeeeeee"/> </log> </else> </filter> </inSequence> <outSequence> <send/> </outSequence> </resource> </api> Thanks Dilusha before loop back to out sequence whether the USER_NAME and PATIENT_ID are equal. -- *Best Regards,Dilusha Alphonso* *Software Engineer - Support Team* *WSO2* *Mobile : * *+94766837098[image: http://wso2.com/signature] <http://wso2.com/signature>*
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
