我们如何从mule调用HTTP servlet ?



我有一个需求,我需要从骡子流调用servlet。我从下面的网站得到了一个答案

http://mule.1045714.n5.nabble.com/Creating-query-string-for-calling-a-servlet-td2665836.html

但是当我在我的流程中复制该代码时,它在流程中显示了一些错误。是否有其他方法或解决方案从mule调用servlet ?我有servlet URL和用户名和密码。我使用的是mule 3.5 anypoint studio。请帮助我完成这项任务

编辑:(粘贴自OP的评论)

<flow name="CallServletServiceFlow1" doc:name="CallServletServiceFlow1">
  <http:inbound-endpoint exchange-pattern="request-response" doc:name="HTTP" address="localhost:8080/servlet"/>
  <object-to-string-transformer doc:name="Object to String"/>
  <http:outbound-endpoint exchange-pattern="request-response" user="javauser" password="javauser1" method="GET" doc:name="HTTP" address="servlet/customTaskServlet?" connector-ref="HTTP_HTTPS"/>
</flow>

你似乎在Mule 3中复制旧的Mule 2语法,所以这无法工作。

在流中使用一个简单的HTTP出站端点。

引用:引用http://www.mulesoft.org/documentation/display/current/HTTP +运输+

编辑:如果在HTTP端点中使用address属性(而不是hostportpath),则需要指定方案。例如,您应该将address="localhost:8080/servlet"替换为address="http://localhost:8080/servlet"

最新更新