Versions Compared

Key

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

...

  • no annotations
  • jsr181 annotations
  • commons-attributes annotations
  • aegis binding
  • jaxb2 binding
  • xmlbeans binding
  • wsdl auto generation
  • MTOM / attachments support

Installation

Installing the servicemix-http component can be done in several ways:

...

Info
titleEndpoint attributes
borderStylesolidbgColor='lighblue'

Name

Type

Description

Required

annotations

String

The annotations used to configure the service. Can be "none", "java5", "jsr181", "commons". If not specified, the annotations type will be discovered by looking at the class.

no

endpoint

String

JBI Endpoint name

no (will be auto-generated if not specified)

interfaceName

QName

Interface QName implemented by the JBI endpoint

no (will be auto-generated if not specified)

mtomEnabled

boolean

Enable MTOM / attachment support

no (defaults to false)

pojo

Object

the instanciated POJO to service requests

one of pojo or pojoClass

pojoClass

String

the class name of the POJO to service requests

one of pojo or pojoClass

service

QName

JBI Service name

no (will be auto-generated if not specified)

serviceInterface

String

the class name of the interface to expose as a service

no

typeMapping

String

Can be "default", "xmlbeans", "jaxb2". Defaults to "default" (Aegis) if no annotations used, else defaults to "jaxb2"

no

wsdlResource

Spring resource

if set, the wsdl will be retrieved from the given Spring resource

no

...

You can use it from one of you client bean, or from inside another component, and call the JBI endpoint as a plain Java object.

Code Block
langjava
  private Echo echo;
  
  public void setEcho(Echo echo) {
    this.echo = echo;
  }

  public void myMethod() {
    String result = echo.echo("world");
    ...
  }

...

Code Block
langxml
<jsr181:endpoint annotations="none" service="my:ejb" endpoint="ejb" 
                 serviceInterface="foo.bar.Hello">
  <jsr181:pojo>
    <bean class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
      <property name="jndiName" value="my/jndi/path"/>
      <property name="businessInterface" value="foo.bar.Hello"/>
      <property name="jndiTemplate" ref="jndiTemplate"/>
    </bean>
  </jsr181:pojo>
</jsr181:endpoint>

MTOM support

MTOM is a way to handle large amounts of binary data in your services. Unlike attachments, the XML infoset stays the same. MTOM just "optimizes" any base64Binary data you have in your messages. When MTOM is turned on, this base64 data gets sent as a binary attachment saving time and space.

MTOM support can be turned on using:

Code Block
langxml

<jsr181:endpoint mtomEnabled="true" ... />

MTOM is supported for the following classes:

  • DataSource
  • DataHandler
  • byte[]

If you have a bean with the following method:

Code Block
langjava

public String echo(String msg, DataHandler binary) {
  ...
}

you will be able to call it using the following requests:

Code Block
langxml
<echo xmlns:xop='http://www.w3.org/2004/08/xop/include'>
  <msg>hello world</msg>
  <binary>
    <xop:Include href='binary'/>
  </binary>
</echo>

provided that the JBI message contains an attachment named "binary".