J'ai créé une API dans esb comme cet extrait:URL paramètre wso2esb
<api xmlns="http://ws.apache.org/ns/synapse" name="contact_v1"
<resource methods="GET" uri-template="/contact-by-email?email={query.param.email}" inSequence="crm_contact-by-email_v1" outSequence="crm_contact-by-email_v1" faultSequence="crm_contact-by-email-error_v1"/>
</api>
Dans ma séquence, je récupère le param de demande, e-mail, comme
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="crm_contact-by-email_v1" xmlns="http://ws.apache.org/ns/synapse">
<in>
<script language="js"><![CDATA[try {
var randomnumber1=Math.floor((Math.random() * 10000) + 1);
mc.setProperty("sessionnumber", randomnumber1.toString());
} catch(e) {
}]]></script>
<property expression="$axis2:REST_URL_POSTFIX" name="myURL"
scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<script language="js"><![CDATA[try {
var log = mc.getServiceLog();
var email = mc.getProperty('query.param.email');
log.info("emailxxxxxx "+email);
} catch(e) {}]]></script>
</in>
<out>
<send/>
<drop/>
</out>
</sequence>
Quand je fais une demande avec un email d'encodage comme ça
test%40test.com
cela fonctionne sans problème.
Mais quand je fais une demande avec
[email protected]
il affiche cette erreur
<tp:fault xmlns:tp="https://xxxxxxx.com/"><tp:code>404</tp:code><tp:type>Status report</tp:type><tp:message>Not Found</tp:message><tp:description>The requested resource (//[email protected]) is not available.</tp:description></tp:fault>
Auriez-vous une idée
Meilleures salutations
Merci @maheeka. Ça marche –