ESQL语句中常用到的代码 2

xsl方式拼报文的格式
"<?xml version=""1.0"" encoding=""UTF-8""?>
<xsl:stylesheet xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"">
<xsl:template match=""ass:QueryFFNRequest"" xmlns:ass=""http://www.huawei.com/BSS/HCDM/Message/Assurance"">
<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/""
xmlns:bus=""http://www.huawei.com/bme/cbsinterface/cbs/businessmgrmsg""
xmlns:com=""http://www.huawei.com/bme/cbsinterface/common""
xmlns:bus1=""http://www.huawei.com/bme/cbsinterface/cbs/businessmgr"">
   <soapenv:Header/>
   <soapenv:Body>    
      <bus:QuerySubFamilyNoRequestMsg>
        <RequestHeader>
       <com:CommandId><xsl:value-of select=""com:RequestHeader/com1:commandId"" 
       xmlns:com=""http://www.huawei.com/BSS/HCDM/Message/Common"" xmlns:com1=""http://www.huawei.com/BSS/HCDM/Common""/></com:CommandId>
"
xsl方式流程要注意的地方 "因为xsl方式其实是以文件方式,理行数据转换,所以当其去请求第三方的时候,第三方的Schema没有绑定,所以我们要加Comput节点中添加:
DELETE FIELD InputRoot.XMLNSC.XmlDeclaration;(删除由xsl方式数据转换之后多出的描述节点)
SET OutputRoot = InputRoot;
  Set OutputRoot.Properties.MessageSet='Huawei_CBS_MSG_LIB';
  Set OutputRoot.Properties.MessageType='{http://www.huawei.com/bme/cbsinterface/cbs/businessmgrmsg}:QuerySubFamilyNoRequestMsg';(添加和第三方的绑定)
  SET OutputRoot.HTTPInputHeader.SOAPAction = 'QuerySubFamilyNo';(设定访问第三方服务的SOAPAction)
 
将请求的原始数据保存
SET Environment.Variables.RequestData = ASBITSTREAM(InputRoot.SOAP.Body CCSID InputProperties.CodedCharSetId);
将值赋给对像,不存在则取定值
SET Environment.Variables.RequestHeader.OutOperID = COALESCE(Environment.Variables.RequestHeader.DEPTID,'') || '|'
|| COALESCE(Environment.Variables.RequestHeader.OPERATORID,'');"
得到请求的Properties
SET OutputRoot.Properties = InputRoot.Properties;
输出不存在的节点用Field创建
create field OutputRoot.XMLNSC.ns:Envelope.ns:Body.activa:Activation.activationRequestMsg;
declare output reference to OutputRoot.XMLNSC.ns:Envelope.ns:Body.activa:Activation.activationRequestMsg;
得到节点下的数据
declare x Integer 1;
  declare z Integer;
  Set z=CARDINALITY(inputAsyn.my_cust:serviceCommandList[]);
  while x <= z do
Set x=x+1;
  end while;"
将保存的数据还原
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(Environment.Variables.XML_DATA CCSID Environment.Variables.Properties.CodedCharSetId);
根据订单下标得到路由地址
SET lableName = Root.XMLNSC.my_cust:CreateCustomerOrderRequest.my_cust:workOrderRequest.Bill_Result:orderInfo.Bill_Result:customerOrderType;

SET localEnv.Destination.RouterList.DestinationData.labelName = lableName;

猜你喜欢

转载自xieguowei123485.iteye.com/blog/1483408
今日推荐