¿Cómo validar parámetros en WSO2?

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>

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.

preguntado el 24 de agosto de 12 a las 08:08

1 Respuestas

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..


Respondido 24 ago 12, 19:08

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

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.