...
From a cxfse Service Unit, it could be used as following:
Code Block | ||
---|---|---|
| ||
<cxfse:endpoint>
<cxfse:pojo>
<bean class="org.apache.servicemix.cxfse.GreeterImplForClientProxy">
<property name="calculator">
<cxfse:proxy service="calculator:CalculatorService" context="#context" type="org.apache.cxf.calculator.CalculatorPortType" />
</property>
</bean>
</cxfse:pojo>
</cxfse:endpoint>
|
Code Block | ||
---|---|---|
| ||
private CalculatorPortType calculator; public void setCalculator(CalculatorPortType calculator) { this.calculator = calculator; } public CalculatorPortType getCalculator() { return calculator; } public void myMethod() { int ret = 0; try { ret = getCalculator().add(1, 2); } catch (Exception e) { e.printStackTrace(); } ... } |
You can find a complete proxy test case here
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 | ||
---|---|---|
| ||
<jsr181<cxfse:endpoint mtomEnabled="true" ... /> |
...
provided that the JBI message contains an attachment named "binary".
You can find a complete MTOM test case here
Interceptors Configuration
Since cxfse is using apache cxf internally, so you can configure cxf se endpoint with inteceptors which follow cxf inteceptor api.
example per as below
Code Block | ||
---|---|---|
| ||
<cxfse:endpoint> <cxfse:pojo> <bean class="org.apache.cxf.calculator.CalculatorImpl"> </bean> </cxfse:pojo> <cxfse:inInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> </cxfse:inInterceptors> <cxfse:outInterceptors> <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> </cxfse:outInterceptors> <cxfse:inFaultInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> </cxfse:inFaultInterceptors> <cxfse:outFaultInterceptors> <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> </cxfse:outFaultInterceptors> </cxfse:endpoint> |