¿Cómo validar parámetros en WSO2?
Frecuentes
Visto 646 veces
2
I have a service need to validate parameters. For example,my request is:
<purchasePackage xmlns="http://bss.internal.service.boss.sysway.com/">
<entitlementId xmlns="">20100812151324</entitlementId>
<subscriberId xmlns="" />
<packageId xmlns="">SZ_VOD</packageId>
<deviceId xmlns="">801830456396</deviceId>
<effectionTime xmlns="">2010-08-25 00:00:00</effectionTime>
<expirationTime xmlns="">2009-08-25 00:00:00</expirationTime>
</purchasePackage>
EffectionTime is later than expirationTime, so I need response a error message out instead of send it to real service. How to do this?Someone can give me some advises?Best regards.
1 Respuestas
1
Use WSO2 ESB server and define custom proxy. When proxy receives the above request, pick both date values using xpath (use filter mediator) and compare which is greater value. You can use XPATh function for that(date comparison) if greater allow to send to the service ..else execute fault sequence..
http://wso2.org/project/esb/java/4.0.3/docs/mediators/filter.html
Respondido 24 ago 12, 19:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas validation response wso2 or haz tu propia pregunta.
Thanks,Ratha, your advise is very helpful,that's very kind of you. I know how to drop message. But how to send an error message back to the client? - ayan117
You can use " make fault mediator" Go through the following post..it has all explanations.. techfeast-hiranya.blogspot.com/2010/04/… - Ratha