Hi all,

I am trying to use validate mediator to validate xml data against XSD file.
But I just found it didn't work. The validation always failed because the
left angle bracket was transformed to < before it was validated.

This is my proxy file.

<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="
http://ws.apache.org/ns/synapse"; name="schemavalidate" transports="https
http" startOnLoad="true" trace="disable">
    <description/>
    <target>
        <inSequence>
            <log level="full"/>
            <validate>
                <schema key="fpavschema"/>
                <on-fail>
                    <log level="full"/>
                    <makefault version="soap12">
                        <code xmlns:soap12Env="
http://www.w3.org/2003/05/soap-envelope"; value="soap12Env:VersionMismatch"/>
                        <reason value="Bad format"/>
                    </makefault>
                    <send/>
                </on-fail>
            </validate>
        </inSequence>
    </target>
</proxy>

Does anyone have any idea about that? If I added a mediator to change &lt;
back to '<', I can pass the validation but backend web service would fail.
If I added another mediator to change '<' back to &lt; again before send
the request to the backend, all things work without problems. But I doubt
that is not the correct way. There must be something wrong about the
configuration, such as 'messageFormatter' or 'messageBuilder'. But I didn't
get a clue.

Here is workable in-sequence.

'&lt;' to '<' mediator   ----------> validate mediator ----------> '<' to
'&lt;' mediator ---------------> backend web service


Regards,
  Bin
_______________________________________________
User mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/user

Reply via email to