2

First of all, I haven't found any generic open source implementation for ebxml/ebms, for me it's somehow strange or maybe I have looked up the wrong stuff, but I haven't found here something rly usefull.

When I was looking for ebxml/ebms I have also found JAXM/SAAJ(JSR 67). It looks like this implementations never got to an end, all links regarding this are refering to the sun homepage which doesn't exist anymore. From the sun homepage you get redirected to the oracle homepage, and there I can't find something about JAXM or JSR 67.

This leads me to my question, how to implement an ebxml service in apache camel?

  1. Should I create the ebxml SOAP message "manually" or are there some libs I've missed that are generating such an ebxml message for me?`
  2. How to send such an ebXml SOAP message via apache camel? Cxf needs an wsdl, for the service we want to call there exists no wsdl.
  3. How to recieve such ebXml messages? Cxf see above, maybe with an http consumer like netty-http or jetty?
soilworker
  • 1,317
  • 1
  • 15
  • 32
  • 1
    ebXML is a non-standard standard rival to SOAP and WS-* . When SOAP won, the original ebXML spec was modified to use SOAP Attachments for its headers. By that time though, WS-* were on the works and SOAP Attachments were deprecated. The global standard is SOAP and the WS-* specs – Panagiotis Kanavos Jan 21 '16 at 14:01

2 Answers2

3

A few years too late, but maybe valuable for others :)

There is an open source implementation available which supports the ebMS 2.0 spec. This ebMS adapter can be deployed as a Mule ESB plugin or as a regular WAR application.

https://sourceforge.net/projects/muleebmsadapter/

Despite being on sourceforge, it is still being actively developed.

scuro
  • 828
  • 8
  • 12
1
  1. You can use velocity template to create the ebxml SOAP message manually, for example.

Template example:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:ser="http://test/Service">
   <soap:Header/>
   <soap:Body>
      <ser:insertRequest>
         <ser:routingHeader>
            <ser:operationType>${headers.OPERATION_TYPE}</ser:operationType>
            <ser:messageId>${exchange.properties.messageId}</ser:messageId>
            <ser:sourceId>${exchange.properties.sourceId}</ser:sourceId>
            <ser:destinationId>${exchange.properties.destinationId}</ser:destinationId>
         </ser:routingHeader>
         <ser:datagram>
            ${body}
         </ser:datagram>
      </ser:insertRequest>
   </soap:Body>
</soap:Envelope>
  1. You can use http, http4 or jetty components to send such an ebXml SOAP message via apache camel.

            to("jetty:http://{{server.host}}:{{server.http.port}}/service/").
            log(LoggingLevel.INFO, "HTTP response code: ${in.header.CamelHttpResponseCode}")
    
  2. After you only need to parse SOAP response manually (XPath, maybe), or you can transform response by XSLT. Maybe you can use beanio, xstream or jaxb and so on to transform XML to POJO.


    ....
        to("velocity:file:///{{karaf.home}}/etc/vm/ws-message-oc.vm?contentCache=true").                                
    setProperty(Exchange.CONTENT_TYPE).constant("application/soap+xml").
        setProperty(Exchange.CONTENT_ENCODING).constant("gzip").
        setProperty(Exchange.CHARSET_NAME).constant("utf-8").
        //log(LoggingLevel.INFO, "WS request: ${body}").
        to("jetty:http://{{app-server.host}}:{{app-server.http.port}}/service/").
        log(LoggingLevel.INFO, "HTTP response code: ${in.header.CamelHttpResponseCode}")
        //log(LoggingLevel.INFO, "WS response: ${body}")
        .setHeader("callRC").xpath("//ser:callRC/text()", String.class, XmlNamespaces.NAMESPACES.getNamespace())
    ....

Alexey Yakunin
  • 1,743
  • 1
  • 19
  • 21
  • Looks like a lot of manually work to do. I thought ebXml should be a global standard for exchanging business documents. I'm just wondering why I can't find no utils/implementations or something else which makes this easier to implement. – soilworker Nov 04 '15 at 14:40