代码之家  ›  专栏  ›  技术社区  ›  Sándor Hatvani

IBM集成总线Web服务客户端请求

  •  0
  • Sándor Hatvani  · 技术社区  · 8 年前

    我必须向soap web服务发送一个预定的请求,请求中包含附件(zip)和元数据。数据和文件在.net计算节点中准备,soap请求节点由wsdl文件生成。不幸的是,我不知道如何将元数据和文件从.net compute节点传递到soap请求节点。元数据在 信封的标签,附件的uuid在 尸体的标签。文件进入附件部分。

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:tag="http://....">    
     <soap:Header>
      <tag:metadata>
         <tag:filename>filename</tag:filename>
         <tag:date>2018-06-01</tag:date>
      </tag:metadata>    
     </soap:Header>    
     <soap:Body>
      <tag:file>
         <tag:content>cid:4444444</tag:content>
      </tag:file>
     </soap:Body>
    </soap:Envelope>
    

    有人能帮帮我吗?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Attila Repasi    8 年前

    soap节点支持mtom附件处理,所以iib会自动处理。IIB知识中心概述了这些要求:

    An MTOM output message is written if all of the following criteria are met:
    
    The Allow MTOM property is selected on the WS Extensions tab.
    
    Validation is enabled. The Validate property on the SOAPRequest and SOAPAsyncRequest nodes controls validation of the anticipated response message and not validation of the outgoing request. MTOM output is therefore suppressed unless you set Validate to Content and value on a preceding input node or transformation node.
    
    No child elements exist below SOAP.Attachment in the logical tree. If child elements are present, SOAP with Attachments (SwA) is used.
    
    Elements exist in the output message that are identified as base64Binary in the associated XML Schema and whose length does not fall below a default threshold size of 1000 bytes.
    

    https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ac56630_.htm

    因此,只需将二进制数据作为blob放在content元素中(前提是它在模式中具有正确的类型),然后如上所述配置流。