[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wsf-javascript-user
Subject:    [User] Validate mediator and left angle bracket
From:       Maeglin Vardamir <belcon () gmail ! com>
Date:       2012-09-20 8:19:51
Message-ID: CACVTwgAcY+e-AJfrc7+yZOeJMhp4siupeYNzS6WsQeSK+8wcPQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 &lt; 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

[Attachment #5 (text/html)]

Hi all,<div><br></div><div>I am trying to use validate mediator to validate xml data \
against XSD file. But I just found it didn&#39;t work. The validation always failed \
because the left angle bracket was transformed to &amp;lt; before it was \
validated.</div> <div><br></div><div>This is my proxy \
file.</div><div><br></div><div><div>&lt;?xml version=&quot;1.0&quot; \
encoding=&quot;UTF-8&quot;?&gt;&lt;proxy xmlns=&quot;<a \
href="http://ws.apache.org/ns/synapse">http://ws.apache.org/ns/synapse</a>&quot; \
name=&quot;schemavalidate&quot; transports=&quot;https http&quot; \
startOnLoad=&quot;true&quot; trace=&quot;disable&quot;&gt;</div> <div>    \
&lt;description/&gt;</div><div>    &lt;target&gt;</div><div>        \
&lt;inSequence&gt;</div><div>            &lt;log \
level=&quot;full&quot;/&gt;</div><div>            &lt;validate&gt;</div><div>         \
&lt;schema key=&quot;fpavschema&quot;/&gt;</div> <div>                \
&lt;on-fail&gt;</div><div>                    &lt;log \
level=&quot;full&quot;/&gt;</div><div>                    &lt;makefault \
version=&quot;soap12&quot;&gt;</div><div>                        &lt;code \
xmlns:soap12Env=&quot;<a \
href="http://www.w3.org/2003/05/soap-envelope">http://www.w3.org/2003/05/soap-envelope</a>&quot; \
value=&quot;soap12Env:VersionMismatch&quot;/&gt;</div> <div>                        \
&lt;reason value=&quot;Bad format&quot;/&gt;</div><div>                    \
&lt;/makefault&gt;</div><div>                    &lt;send/&gt;</div><div>             \
&lt;/on-fail&gt;</div><div>            &lt;/validate&gt;</div> <div>        \
&lt;/inSequence&gt;</div><div>    \
&lt;/target&gt;</div><div>&lt;/proxy&gt;</div></div><div><br></div><div>Does anyone \
have any idea about that? If I added a mediator to change &amp;lt; back to \
&#39;&lt;&#39;, I can pass the validation but backend web service would fail. If I \
added another mediator to change &#39;&lt;&#39; back to &amp;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 \
&#39;messageFormatter&#39; or &#39;messageBuilder&#39;. But I didn&#39;t get a \
clue.</div> <div><br></div><div>Here is workable \
in-sequence.</div><div><br></div><div>&#39;&amp;lt;&#39; to &#39;&lt;&#39; mediator   \
----------&gt; validate mediator ----------&gt; &#39;&lt;&#39; to &#39;&amp;lt;&#39; \
mediator ---------------&gt; backend web service</div> \
<div><br></div><div><br></div><div>Regards,</div><div>  Bin  </div>



_______________________________________________
User mailing list
User@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/user


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic