我有一个要求,我需要从mule flow调用一个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>
答案 0 :(得分:0)
你似乎在Mule 3中复制旧的Mule 2语法,所以这不起作用。
只需在流程中使用简单的HTTP出站端点即可。
参考:http://www.mulesoft.org/documentation/display/current/HTTP+Transport+Reference
编辑:如果您在HTTP端点中使用address
属性(而不是host
port
和path
),则需要指定方案。例如,您应该将address="localhost:8080/servlet"
替换为address="http://localhost:8080/servlet"
。