Ejemplo n.º 1
0
  public void getCBSArsHeader(String method, SOAPMessage message) throws Exception {
    SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();
    envelope.addNamespaceDeclaration("arcl", "http://www.huawei.com/ar/wsservice/arcommon");
    envelope.addNamespaceDeclaration("cbs", "http://www.huawei.com/bme/cbsinterface/cbscommon");
    envelope.addNamespaceDeclaration(
        "arc", "http://www.huawei.com/bme/cbsinterface/arcustomizedservices");
    SOAPBody body = envelope.getBody();
    SOAPElement bodyElement = body.addChildElement(method, "arc");
    SOAPElement requestHeaderElement = bodyElement.addChildElement("RequestHeader");
    requestHeaderElement.addChildElement("Version", "cbs").addTextNode("1.0");
    requestHeaderElement
        .addChildElement("MessageSeq", "cbs")
        .addTextNode(BssServiceUtils.generateTransactionId());

    SOAPElement accessSecurityElement =
        requestHeaderElement.addChildElement("AccessSecurity", "cbs");
    accessSecurityElement
        .addChildElement("LoginSystemCode", "cbs")
        .addTextNode(SYSConfig.getConfig().get("cbs.inf.accessUser"));
    accessSecurityElement
        .addChildElement("Password", "cbs")
        .addTextNode(SYSConfig.getConfig().get("cbs.inf.accessPwd"));
    requestHeaderElement
        .addChildElement("AccessMode", "cbs")
        .addTextNode(SYSConfig.getConfig().get("cbs.inf.channelCode"));
  }
Ejemplo n.º 2
0
 @Override
 public ProcessResult process(
     RequestInfo requestInfo, Map<String, String> handler, Map<String, Object> extParameters)
     throws Exception {
   RequestInfo newRequestInfo = BssServiceUtils.copyRequestInfo(requestInfo);
   newRequestInfo.getRequestHeader().setBizCode("xchangePromotion");
   return SoapCallUtils.process(
       this,
       newRequestInfo,
       newRequestInfo.getRequestBody().getServiceNumber(),
       newRequestInfo.getRequestBody().getExtParameters(),
       handler,
       "ws.cbs.query.timeout");
 }
Ejemplo n.º 3
0
  @Override
  public ProcessResult getResposeResult(SOAPMessage response) throws Exception {
    ProcessResult result = new ProcessResult();
    XchangeLogVO xchangeLogVO = new XchangeLogVO();
    result.setVo(xchangeLogVO);
    org.w3c.dom.Document document = BssServiceUtils.getSoapMessageDocument(response);
    if (document.getElementsByTagName("cbs:ResultCode").getLength() > 0) {

      String retCode = document.getElementsByTagName("cbs:ResultCode").item(0).getTextContent();
      result.setResultCode(retCode);
    }
    if (document.getElementsByTagName("cbs:ResultDesc").getLength() > 0) {

      String retMsg = document.getElementsByTagName("cbs:ResultDesc").item(0).getTextContent();
      result.setResultDesc(retMsg);
    }
    if (document.getElementsByTagName("XchangePromotionResult").getLength() > 0) {
      NodeList xchangePromotionResultNodes =
          document.getElementsByTagName("XchangePromotionResult").item(0).getChildNodes();
      for (int i = 0; i < xchangePromotionResultNodes.getLength(); i++) {
        Node node = xchangePromotionResultNodes.item(i);
        if ("arc:applierNumber".equals(node.getNodeName())) {
          xchangeLogVO.setApplierNumber(node.getTextContent());
        } else if ("arc:receiverNumber".equals(node.getNodeName())) {
          xchangeLogVO.setReceiverNumber(node.getTextContent());
        } else if ("arc:deductAmount".equals(node.getNodeName())) {
          xchangeLogVO.setDeductAmount(node.getTextContent());
        } else if ("arc:transferFee".equals(node.getNodeName())) {
          xchangeLogVO.setTransferFee(node.getTextContent());
        } else if ("arc:bonusAmount".equals(node.getNodeName())) {
          xchangeLogVO.setBonusAmount(node.getTextContent());
        } else if ("arc:bonusExpTime".equals(node.getNodeName())) {
          xchangeLogVO.setExpiryTime(node.getTextContent());
        }
      }
    }
    return result;
  }