【问题标题】:Mule malformed endpoint errorMule 格式错误的端点错误
【发布时间】:2014-04-22 18:01:55
【问题描述】:

我是 Mule 的新手并尝试使用 HTTP 端点发布 GET 请求,但收到以下错误

“模板端点“http://api.mymemory.translated.net:80/get?q=#[message.inboundProperties.get('http.relative.path')]&langpair=EN|IT”解析为格式错误的端点“http://api.mymemory.translated.net:80/get?q=hello&langpair=EN|IT”。无法通过端点路由事件:org.mule.endpoint。动态出站端点”

我尝试了以下配置:

get?q=hello&langpair=EN%7CIT[工作]

get?q=#[message.inboundProperties.get('http.relative.path')]&langpair=EN%7CIT [不工作]

get?q=#[message.inboundProperties.get('http.relative.path')]&langpair=EN|IT [不工作]

堆栈跟踪似乎表明“|”有问题字符。

我的流程如下:

<flow name="my_first_projectFlow1" doc:name="my_first_projectFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/> <http:outbound-endpoint exchange-pattern="request-response" host="api.mymemory.translated.net" port="80" path="get?q=#[message.inboundProperties.get('http.relative.path')]&amp;langpair=EN%7CIT" method="GET" doc:name="HTTP"/> <echo-component doc:name="Echo"/> </flow>

【问题讨论】:

    标签: java http rest mule mule-el


    【解决方案1】:

    尝试将管道 ("|") 字符替换为 MEL 表达式 #[java.net.URLEncoder.encode('|', 'UTF-8')]

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-13
      • 1970-01-01
      • 1970-01-01
      • 2014-10-16
      • 1970-01-01
      • 1970-01-01
      • 2012-12-13
      • 1970-01-01
      相关资源
      最近更新 更多