No, you can use HTTP or CXF-BC, both are usable.
Regards
JB
bgoetzmann wrote:
Thank you Jean-Baptiste,
In this case, as I'm also using servicemix-http to expose the POJO service
on HTTP, I suppose I should use sm-cxf-bc?
Bertrand.
Jean-Baptiste Onofré wrote:
Hi Bertrand,
The JSR181 component is quite deprecated now. I heavily recommand you to
use the CXF-SE component in place of.
In your case, you can do:
<beans xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
xmlns:mp="...">
<cxfse:endpoint service="test" endpoint="test">
<cxfse:pojo>
<bean class="com.odelia.metaphora.Foobar"/>
</cxfse:pojo>
</cxfse>
</beans>
with your POJO annotated (with a corresponding interface).
Check the sample:
http://servicemix.apache.org/602-intermediate-creating-the-cxf-su.html
Regards
JB
bgoetzmann wrote:
Hello,
Using SM's servicemix-jsr181 component I deployed a POJO service with the
xbean.xml file:
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
xmlns:mp="http://odelia-technologies.com/metaphora">
<property name="context" ref="context" />
<jsr181:endpoint annotations="none" service="mp:serviceMtom"
endpoint="serviceMtomEP" mtomEnabled="true">
<jsr181:pojo>
<bean class="com.odelia.metaphora.ServiceMtom">
<property name="repertoire"
value="Metaphora/in"/>
</bean>
</jsr181:pojo>
</jsr181:endpoint>
</beans>
My POJO is simple:
public class ServiceMtom {
...
public void envoyer(String nomfichier, long taille, long decalage,
byte[]
binaire) throws Exception {
...
}
}
My POJO's envoyer method is well invoked!
Now, under certain conditions when I catch exception in the method
implementation, I would like return a Fault like this:
MessageExchange exchange =
org.apache.servicemix.jsr181.JBIContext.getMessageExchange();
try {
...
}
} catch (Exception e) {
Fault fault = exchange.createFault();
exchange.setFault(fault);
}
But when tryinh this I get an exception telling me Fault not supported:
INFO - DefaultFaultHandler - Fault occurred!
javax.jbi.messaging.MessagingException: Fault not supported
at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setMessage(MessageExchangeImpl.java:366)
at
org.apache.servicemix.jbi.messaging.MessageExchangeImpl.setFault(Mess
ageExchangeImpl.java:290)
at com.odelia.metaphora.ServiceMtom.envoyer(ServiceMtom.java:100)
Any idea about this exception?
Thank you!
Bertrand.