OpenEJB ApplicationComposer and WebServices (SOAP/REST)

A quick tip to show you ApplicationComposer of OpenEJB can be used to test WebServices too.

In standalone to get the small OpenEJB http layer and be able to test webservices you simply need to add the property openejb.embedded.remotable to true to your properties.

Since last release of OpenEJB you can do the same! Just add this property in your @Configuration.

public Properties config() {
    return new Properties() {{
        setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true");

Then to avoid to build the whole application manually you can simply return the classes you want to deploy:

public static Class<?>[] myApp() throws Exception {
    return new Class<?>[] { Foo.class, Bar.class, MyWebService.class };

Then simply add some test methods:

The default base url will be:<your test simple name>

For instance:

If you want to customize the context simply add to @Configuration properties the property <your test simple name>.moduleId.


2 thoughts on “OpenEJB ApplicationComposer and WebServices (SOAP/REST)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s