字段的IIB前缀

时间:2018-09-26 11:42:19

标签: xml soap ibm-integration-bus

我正在使用IIB 10.0.0.11

当我通过以下消息调用SOAP服务时:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="urn://hfgroup.co.ke/SharedResources/Schemas/SOAMessages/SoapHeader" xmlns:com="urn://hfgroup.co.ke/Common/DataModel/Common/SecureGetBusinessDate/1.0/Common.SecureGetBusinessDate" xmlns:ns="urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0">
   <soapenv:Header>
      <soap:HeaderRequest>
         <soap:Control>
            <soap:RequesterSystemCode>013</soap:RequesterSystemCode>
            <soap:MessageID>45</soap:MessageID>
         </soap:Control>
         <soap:Credentials>
            <soap:Credential>
               <soap:Username>ESBAPP01</soap:Username>
               <soap:Password>!@#$_!K@O#C$E%L^A*_$#@!</soap:Password>
            </soap:Credential>
         </soap:Credentials>
      </soap:HeaderRequest>
   </soapenv:Header>
   <soapenv:Body>
      <com:DataInput>
         <com:SecureGetBusinessDateInput>
            <ns:Security>
               <ns:ChannelId>99997</ns:ChannelId>
            </ns:Security>
         </com:SecureGetBusinessDateInput>
      </com:DataInput>
   </soapenv:Body>
</soapenv:Envelope>

一切正常,但是当我收到此消息时:

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"  >
   <NS1:Header>
      <NS2:HeaderRequest xmlns:NS2="urn://hfgroup.co.ke/SharedResources/Schemas/SOAMessages/SoapHeader">
         <NS2:Control>
            <NS2:RequesterSystemCode>013</NS2:RequesterSystemCode>
            <NS2:MessageID>49</NS2:MessageID>
         </NS2:Control>
         <NS2:Credentials>
            <NS2:Credential>
               <NS2:Username>ESBAPP01</NS2:Username>
               <NS2:Password>!@#$_!K@O#C$E%L^A*_$#@!</NS2:Password>
            </NS2:Credential>
         </NS2:Credentials>
      </NS2:HeaderRequest>
   </NS1:Header>
   <NS1:Body>
      <NS3:DataInput xmlns:NS3="urn://hfgroup.co.ke/Common/DataModel/Common/SecureGetBusinessDate/1.0/Common.SecureGetBusinessDate">
         <NS3:SecureGetBusinessDateInput>
            <NS4:Security xmlns:NS4="urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0">
               <NS4:ChannelId>99997</NS4:ChannelId>
            </NS4:Security>
         </NS3:SecureGetBusinessDateInput>
      </NS3:DataInput>
   </NS1:Body>
</NS1:Envelope>

IIB将前缀NS3和NS4作为字段,稍后我将在服务中出错:

调试中的树变量:

SOAP
    Context
           Namespace
                    NS1:CHARACTER:http://schemas.xmlsoap.org/soap/envelope/

Body
    DataInput
            NS3:CHARACTER:urn://hfgroup.co.ke/Common/DataModel/Common/SecureGetBusinessDate/1.0/Common.SecureGetBusinessDate
            SecureGetBusinessDateInput
                    Security
                            NS4:CHARACTER:urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0
                            ChannelId:CHARACTER:99997

由于没有前缀作为字段,如何解决此问题?

发送到服务的日志:

0x03000102:NamespaceDecl):xmlns                                           = 'urn://hfgroup.co.ke/Common/DataModel/Common/GetBusinessDate/1.0/Common.GetBusinessDate' (CHARACTER)
      (0x03000102:NamespaceDecl)xmlns:nsS100                                     = 'urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0' (CHARACTER)
      (0x03000102:NamespaceDecl)xmlns:soapenv                                    = 'http://schemas.xmlsoap.org/soap/envelope/' (CHARACTER)
      (0x01000000:Folder       )http://schemas.xmlsoap.org/soap/envelope/:Body   = (
        (0x01000000:Folder)urn://hfgroup.co.ke/Common/DataModel/Common/GetBusinessDate/1.0/Common.GetBusinessDate:DataInput = (
          (0x01000000:Folder)urn://hfgroup.co.ke/Common/DataModel/Common/GetBusinessDate/1.0/Common.GetBusinessDate:GetBusinessDateInput = (
            (0x01000000:Folder)urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0:Security = (
              (0x03000000:PCDataField)http://www.w3.org/2000/xmlns/:NS4                              = 'urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0' (CHARACTER)
              (0x03000000:PCDataField)urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0:ChannelId = '99997' (CHARACTER)
              (0x03000000:PCDataField)urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0:CoreToken = 'Z]XWVUTSr>P<NW>Mw;MZ' (CHARACTER)
            )
          )
        )

1 个答案:

答案 0 :(得分:0)

我在您的评论中看到您没有正确声明SOAP名称空间:它错过了前导http://。请这样尝试:

DECLARE ns250 NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE nszF00 NAMESPACE 'urn://hfgroup.co.ke/Common/DataModel/Common/GetBusinessDate/1.0/Common.GetBusinessDate';
DECLARE nsS100 NAMESPACE 'urn://hfgroup.co.ke/CanonicalDataModel/Security/1.0';
SET OutputRoot.XMLNSC.ns250:Envelope.(XMLNSC.NamespaceDecl)xmlns = nszF00;
SET OutputRoot.XMLNSC.ns250:Envelope.(XMLNSC.NamespaceDecl)xmlns:nsS100 = nsS100;
SET OutputRoot.XMLNSC.ns250:Envelope.(XMLNSC.NamespaceDecl)xmlns:soapenv = ns250;

从您的注释和跟踪输出中,我还可以看到您从Environment复制了数据;跟踪中的PCDataField字段告诉我Environment中没有域信息(请参阅similiar problem)。这里是InfoCenter

的引用
  

在许多情况下,将消息树(或消息树的一部分)复制到环境中可能很有用,但是在复制结构之前创建正确的域至关重要。在复制输入消息的片段之前忘记为环境树分配正确的域会导致树的膨胀在复制发生之前发生

因此,请将您的输入数据复制到Environment

CREATE LASTCHILD OF Environment DOMAIN 'XMLNSC' FROM InputRoot.XMLNSC;