实现的ebXML / EBMS与Apache骆驼的最佳方法 [英] Best way to implement ebXml/ebMs with apache camel

查看:138
本文介绍了实现的ebXML / EBMS与Apache骆驼的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我还没有发现的ebXML / EBMS任何通用的开源实现,对我来说是陌生的不知何故也许我已经看过了错误的东西,但我还没有在这里找到一些有用的RLY。

当我正在寻找的ebXML / EBMS我还发现JAXM / SAAJ(JSR 67)。它看起来像这样的实现从来没有结束,所有与此相关链接指的是太阳网页不存在了。来自太阳的主页之前重定向到Oracle的主页,还有我无法找到一些关于JAXM或JSR 67。

这使我对我的问题,如何在Apache的骆驼实施的ebXML服务?


  1. 我应该创造手动的ebXML的SOAP消息,还是有一些库我已经错过了正在生成我这么一个ebXML信息?`

  2. 如何通过Apache的骆驼发出这种ebXML的SOAP消息? CXF需要一个WSDL,因为我们要调用不存在的WSDL服务。

  3. 如何收到这样的ebXML消息? CXF上面看到的,也许与HTTP消费者喜欢网状-HTTP或码头?


解决方案

  1. 您可以使用速度模板手动创建的ebXML SOAP消息,例如。

模板例如:

<?XML版本=1.0编码=UTF-8&GT?;
<肥皂:信封的xmlns:SOAP =htt​​p://www.w3.org/2003/05/soap-envelope
               的xmlns:SER =HTTP://测试/服务>
   <肥皂:页眉/>
   <肥皂:身体与GT;
      < SER:insertRequest>
         < SER:routingHeader>
            < SER:operationType> $ {headers.OPERATION_TYPE}< / SER:operationType>
            < SER:MESSAGEID> $ {exchange.properties.messageId}< / SER:MESSAGEID>
            < SER:&的sourceID GT; $ {exchange.properties.sourceId}< / SER:&的sourceID GT;
            < SER:destinationId> $ {exchange.properties.destinationId}< / SER:destinationId>
         < / SER:routingHeader>
         < SER:数据报>
            $ {}体
         < / SER:数据报>
      < / SER:insertRequest>
   < / SOAP:身体与GT;
< / SOAP:信封>

<醇开始=2>

  • 您可以使用 HTTP http4 码头组件通过Apache的骆驼发出这种ebXML的SOAP消息。

     来(码头:HTTP:// {{server.host}} {{server.http.port}} /服务/)。
            日志(LoggingLevel.INFO,HTTP响应code:$ {in.header.CamelHtt presponse code})


  • 在你只需要手动解析SOAP响应(XPath的,也许),也可以通过转换XSLT响应。
    也许你可以使用beanio,XStream的或JAXB等来转换XML到POJO。


  •     ....
            以(速度:文件:/// {{karaf.home}} /etc/vm/ws-message-oc.vm?contentCache=true)。
        的setProperty(Exchange.CONTENT_TYPE).constant(应用程序/肥皂+ XML)。
            的setProperty(Exchange.CONTENT_ENCODING).constant(gzip的)。
            的setProperty(Exchange.CHARSET_NAME).constant(UTF-8)。
            //log(LoggingLevel.INFO,WS请求:$ {}体)。
            以(码头:HTTP:// {{app-server.host}} {{APP-server.http.port}} /服务/)。
            日志(LoggingLevel.INFO,HTTP响应code:$ {in.header.CamelHtt presponse code})
            //log(LoggingLevel.INFO,WS响应:$ {身体})
            .setHeader(callRC)的XPath(// SER:callRC /文本(),为String.class,XmlNamespaces.NAMESPACES.getNamespace())。
        ....

    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?

    解决方案

    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())
        ....
    
    

    这篇关于实现的ebXML / EBMS与Apache骆驼的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆