CTOCIO IT专家网

天极传媒 比特网 | 天极网 | IT专家网 | IT商网 | 52PK游戏网 | 手机天极 | IT分众 |
IT专家网搜索

您现在的位置: IT专家网 > Web服务子站 > 技巧

ESB开发实践小结

作者: 皮山杉,  出处:Dev2Dev, 责任编辑: 叶江, 
2007-07-05 14:15
  本指南描述了服务总线(ESB)的典型使用场景、设计模式和实践经验……

  下面给出了这些元素的格式定义,这些元素的命名空间为预先定义的”ctx” :

    <element name="attachments" type="mc:AttachmentsType"/>

    <!-- Each attachment in the 'attachments' variable is represented by an instance of this element -->
    <element name="attachment" type="mc:AttachmentType"/>

    <!-- Element used to represent binary payloads and pass-by reference content -->
    <element name="binary-content" type="mc:BinaryContentType"/>

    <complexType name="AttachmentsType">
        <sequence>
            <!-- the 'attachments' variable is just a series of attachment elements -->
            <element ref="mc:attachment" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
    </complexType>
   
    <complexType name="AttachmentType">
        <sequence>
            <!-- Set of MIME headers associated with attachment -->
            <element name="Content-ID" type="string" minOccurs="0"/>
            <element name="Content-Type" type="string" minOccurs="0"/>
            <element name="Content-Transfer-Encoding" type="string" minOccurs="0"/>
            <element name="Content-Description" type="string" minOccurs="0"/>
            <element name="Content-Location" type="string" minOccurs="0"/>
            <element name="Content-Disposition" type="string" minOccurs="0"/>

            <!-- Contains the attachment content itself, either in-lined or as <binary-content/> -->
            <element name="body" type="anyType"/>
        </sequence>
    </complexType>

    <complexType name="BinaryContentType">
        <!-- URI reference to the binary or pass-by-reference payload -->
        <attribute name="ref" type="anyURI" use="required"/>
    </complexType>

  上下文实际处理过程中的一些关键点

  当在一个Xquery中指向一个变量时,该变量的根元素通常没有表达出。例如:一个Xquery的表达式需要获取第一个附件的Content-Description信息,可以表达为:$attachments/ctx:attachment[1]/ctx:Content-Description.

  另一个Xquery示例是获取第二个附件中的订单信息,这样订单的获取为: $attachments/ctx:attachment[2]/ctx:body/*

  当变量为空或只有一个元素,而Xquery返回的是一个序列信息,则当该Xquery被赋给该变量时,只有序列中的第一个元素被存入该变量。例如:如果需要将WS-Addressing MessagerID SOAP头赋予一个变量,而SOAP头只有一个的情况下,赋值动作为:

  assign data($header/wsa:MessageID) to variable idvar.

  注意:如果有两个WS-Addressing MessageID头存在,变量中只包含第一个头的信息。

共7页。 9 1 2 3 4 5 6 7 :

网友评论

笔名 
请您注意:遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。    IT专家网友拥有管理笔名和留言的一切权利。
  • 周排行榜
  • 月排行榜

邮件订阅

       
天极服务 | 关于我们 | 网站律师 | 加入我们 | 联系我们 | 广告业务 | 友情链接 | 我要挑错
All Rights Reserved, Copyright 2004-2008, Ctocio.com.cn
渝ICP证B2-20030003号 如有意见请与我们联系 powered by 天极内容管理平台CMS4i