javax.xml.soap.SOAPHeader.getFirstChild()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中javax.xml.soap.SOAPHeader.getFirstChild()方法的一些代码示例,展示了SOAPHeader.getFirstChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SOAPHeader.getFirstChild()方法的具体详情如下:
包路径:javax.xml.soap.SOAPHeader
类名称:SOAPHeader
方法名:getFirstChild

SOAPHeader.getFirstChild介绍

暂无

代码示例

代码示例来源:origin: com.microsoft.bingads/microsoft.bingads

private String getSpecificHeaderValue(SOAPHeader header, String localName) {
  return (header != null && header.getFirstChild() != null && header.getFirstChild().getLocalName() != null && header.getFirstChild().getLocalName().equals(localName)) ?
      header.getFirstChild().getTextContent() : null;
}

代码示例来源:origin: BingAds/BingAds-Java-SDK

private String getSpecificHeaderValue(SOAPHeader header, String localName) {
  return (header != null && header.getFirstChild() != null && header.getFirstChild().getLocalName() != null && header.getFirstChild().getLocalName().equals(localName)) ?
      header.getFirstChild().getTextContent() : null;
}

代码示例来源:origin: se.skltp.adapterservices.se.apotekensservice/TicketMachine

@Override
public Node getSecurityHeaderWSS(SOAPMessage soapMessage) throws SOAPFaultException {
  final String WSS_SEC_HEADER="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
  SOAPHeader soapHeader = null;
  Node securityHeader = null;
  try {
    soapHeader = soapMessage.getSOAPHeader();
    if(soapHeader == null){
      String message = "SOAP Header must not be null";
      throw new SOAPFaultException(message);
    }
    securityHeader = soapHeader.getFirstChild();			
    if(securityHeader == null || 
      !securityHeader.getLocalName().equals("Security") ||
      !securityHeader.getNamespaceURI().equals(WSS_SEC_HEADER)){
      String message = "Missing or invalid Security Header";
      throw new SOAPFaultException(message);
    }
    
  }catch(Exception e){
    throw new SOAPFaultException(e);
  }
  return securityHeader;		
}

代码示例来源:origin: se.skltp.adapterservices.se.apotekensservice/TicketMachine

/**
 * {@inheritDoc}
 */
public Node getSecurityHeader(SOAPMessage soapMessage) throws SOAPFaultException {
  final String SEC_HEADER="urn:apotekensservice:security:1";
  SOAPHeader soapHeader = null;
  Node securityHeader = null;
  try {
    soapHeader = soapMessage.getSOAPHeader();
    if(soapHeader == null){
      String message = "SOAP Header must not be null";
      throw new SOAPFaultException(message);
    }
    securityHeader = soapHeader.getFirstChild();			
    if(securityHeader == null || 
      !securityHeader.getLocalName().equals("Security") ||
      !securityHeader.getNamespaceURI().equals(SEC_HEADER)){
      String message = "Missing or invalid Security Header";
      throw new SOAPFaultException(message);
    }
    
  }catch(Exception e){
    throw new SOAPFaultException(e);
  }
  return securityHeader;		 
}

代码示例来源:origin: com.hynnet/xws-security

Node currentChild = sh.getFirstChild();

相关文章