Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
{snippet:id=send|lang=xml|url=http://svn.servicemix.codehausapache.org/*checkout*/branchesrepos/asf/incubator/servicemix/trunk/servicemix-1.1/basecomponents/src/test/resources/org/apache/servicemix/components/http/example.xml}

 

Server side HTTP binding

This JBI component will expose another JBI component over HTTP on some port and HTTP configuration. We use an embedded Jetty component for this, though we also have a BindingServlet which can be configured from inside any web.xml in a Servlet WAR.

...

Wiki Markup
{snippet:id=binding|lang=xml|url=http://svn.servicemix.codehausapache.org/*checkout*/branches/repos/asf/incubator/servicemix/trunk/servicemix-1.1/basecomponents/src/test/resources/org/apache/servicemix/components/http/example.xml}

 

Using HTTP binding in a WAR

...

Wiki Markup
{snippet:id=httpBinding|lang=xml|url=http://svn.servicemixapache.codehaus.org/*checkout*/branches/servicemix-1.1repos/asf/incubator/servicemix/trunk/tooling/servicemix-web/src/webapp/WEB-INF/web.xml}

 

Notice that the web.xml then refers to the endpoint name httpBinding in the ServiceMix configuration file. e.g. this component

Wiki Markup
{snippet:id=http|lang=xml|url=http://svn.servicemixapache.codehaus.org/repos/*checkout*asf/branchesincubator/servicemix-1.1/trunk/tooling/servicemix-web/src/webapp/WEB-INF/applicationContext.xml}

 

Example of using the HTTP binding in a WAR

...

Code Block
cd tooling/servicemix-web
maven run

 

Then point your browser to http://localhost:8080/examples/Image Removed

You should see the simple demo which performs a HTTP GET/POST into the JBI container and shows the result in your browser. This example renders better in FireFox which handles XML response types nicer than Safari.

An alternative is to use your existing Servlet engine and type this instead

Code Block
maven war

 

Then deploy the war into your servlet engine. You'll typically need to use a different URL then such as http://localhost:8080/servicemix-web/examples/Image Removed

More detail

See the WAR Deployment