0

It seems like using Servlet end point in Mule is simple, but I get mesh up in some things with lack of understanding. To get a clearer view, can I have a sample code with a servlet endpoint and how call it from Java application.

This is my Mule-config.XML.

<flow name="servletFlow1" doc:name="servletFlow1">
  <servlet:inbound-endpoint path="name" responseTimeout="10000"/>
  <echo-component doc:name="Echo"/>
</flow>

Questions:

  1. How could send and get request in a browser to this application.
  2. How to connect to the this application from Java swing, if this application deployed in Mule Standalone server.

1 Answer 1

0

Answers:

  1. Assuming your web application listens over HTTP, call http://localhost:{http.port}/{web-app-context-path}/{mule-servlet-context-path}/name. Replace the values in { } with what is relevant to you.
  2. If you deploy in Mule standalone, better not use the Servlet transport and prefer the HTTP one. To send HTTP requests from a Java application, one good option is to use the Apache HTTP Client.
8
  • Hi @david Dossot, for question 1 : I m running that application in mule studio itself, as i have seen many of ur commnets that server connector is not mandatory, so how can i identify that this running which url and port, and could i find the {web-app-context-path}/{mule-servlet-context-path}.. plz assit, for ex: for the mule-config.xml how could i frame the context path.. Feb 20, 2013 at 4:07
  • Can i have any sample mule config.xml regarding this, to get better understanding, bcz when i use http endpoint it went smooth, i have request in "localhost:8080/?name=xyz&job=zzz".. but when i change the endpoint to servlet, i couldn't understand well or could send request like in http endpoin Feb 20, 2013 at 4:12
  • If you want to run a JavaEE web application from Studio, you need to install a plug-in like code.google.com/p/run-jetty-run to allow it. Typically the project name will be used as {web-app-context-path}. What you would have put in web.xml would give you {mule-servlet-context-path}. Also read stackoverflow.com/a/14859119/387927 for more info. Feb 20, 2013 at 16:57
  • I am not running JavaEE app in studio, my question is, while run the simple "hello world" mule application in studio / mule runtime, with Servlet end points, how can i form the URL pattern for that, to send a input data like in http endpoints. Feb 21, 2013 at 12:15
  • I answered this question in my response. Feb 21, 2013 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.