LibraryToggle FramesPrintFeedback

Implementing the servlet is easy. You simply add logic to the servlet’s constructor to instantiate the Fuse Services Framework endpoint. Example 5.3 shows an example of instantiating a consumer endpoint in a servlet.


If you choose not to use the default location for the configuration file, then you must add code for loading the configuration file. To load the configuration from a custom location do the following:

  1. Use the ServletContext to resolve the file location into a URL.

  2. Create a new bus for the application using the resolved URL.

  3. Set the application’s default bus to the newly created bus.

Example 5.4 shows an example of loading the configuration from the WEB-INF/client.xml file.


Depending on what other features you want to use, you might need to add additional code to your servlet. For example, if you want to use WS-Security in a consumer you must add code to your servlet to load the credentials and add them to your requests.

Comments powered by Disqus
loading table of contents...