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

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

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

SOAPHeader.examineHeaderElements介绍

[英]Returns an Iterator over all the SOAPHeaderElement objects in this SOAPHeader object that have the specified actor. An actor is a global attribute that indicates the intermediate parties that should process a message before it reaches its ultimate receiver. An actor receives the message and processes it before sending it on to the next actor. The default actor is the ultimate intended recipient for the message, so if no actor attribute is included in a SOAPHeader object, it is sent to the ultimate receiver along with the message body.

In SOAP 1.2 the env:actor attribute is replaced by the env:role attribute, but with essentially the same semantics.
[中]在该SOAPHeader对象中具有指定参与者的所有SOAPHeaderElement对象上返回一个Iterator。参与者是一个全局属性,指示在消息到达最终接收者之前应该处理消息的中间方。参与者接收消息并进行处理,然后将其发送给下一个参与者。默认的actor是消息的最终预期收件人,因此如果SOAPHeader对象中没有包含actor属性,则它将与消息正文一起发送给最终收件人。
在SOAP1.2中,env:actor属性被env:role属性替换,但语义基本相同。

代码示例

代码示例来源:origin: org.springframework.ws/org.springframework.ws

/** Returns all header elements for which the must understand attribute is true, given the actor or role. */
@Override
public Iterator<SOAPHeaderElement> examineMustUnderstandHeaderElements(SOAPHeader header, String actorOrRole) {
  List<SOAPHeaderElement> result = new ArrayList<SOAPHeaderElement>();
  for (Iterator<?> iterator = header.examineHeaderElements(actorOrRole); iterator.hasNext();) {
    SOAPHeaderElement headerElement = (SOAPHeaderElement) iterator.next();
    if (headerElement.getMustUnderstand()) {
      result.add(headerElement);
    }
  }
  return result.iterator();
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Retrieves (and leaves in place) the secured action indormation from the SOAP header.
 *
 * @param header
 * @throws SOAPException
 */
public void examineSamlTicket(SOAPHeader header, SamlTicketFactory factory) throws SOAPException {
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeSamlTicket(iter, factory);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Retrieves (and leaves in place) the fedCatInfos indormation from the SOAP header.
 *
 * @param header
 * @throws SOAPException
 */
//***
public void examineFedCatInfo(SOAPHeader header) throws SOAPException {
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeFedCatInfos(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

public void extractTcRecord(SOAPHeader header) throws SOAPException {
  //Iterator iter = header.extractHeaderElements(Constants.SOAP_ACTOR);
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeTcRecord(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Extracts (gets + removes!) the federatedCatalogIDs information from the SOAP header.
 * Prefer calling extractfederatedCatalogIDs(SOAPEnvelope envelope)!
 *
 * @param header
 * @throws SOAPException
 */
public void extractFederatedCatalogIDs(SOAPHeader header) throws SOAPException {
  //Iterator iter = header.extractHeaderElements(Constants.SOAP_ACTOR);
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeFederatedCatalogIDs(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Retrieves (and leaves in place) the FederatedCatalogIDs indormation from the SOAP header.
 *
 * @param header
 * @throws SOAPException
 */
public void examineFederatedCatalogIDs(SOAPHeader header) throws SOAPException {
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeFederatedCatalogIDs(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Extracts (gets + removes!) the secured action indormation from the SOAP header.
 * Prefer calling extractSecuredAction(SOAPEnvelope envelope)!
 *
 * @param header
 * @throws SOAPException
 */
public void extractSecuredAction(SOAPHeader header) throws SOAPException {
  //Iterator iter = header.extractHeaderElements(Constants.SOAP_ACTOR);
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeSecuredAction(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Retrieves (and leaves in place) the secured action indormation from the SOAP header.
 *
 * @param header
 * @throws SOAPException
 */
public void examineSecuredAction(SOAPHeader header) throws SOAPException {
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeSecuredAction(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

public void examineTcRecord(SOAPHeader header) throws SOAPException {
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeTcRecord(iter);
}

代码示例来源:origin: org.n52.metadata/smarteditor-api

/**
 * Extracts (gets + removes!) the fedCatInfos information from the SOAP header.
 * Prefer calling extractfederatedCatalogIDs(SOAPEnvelope envelope)!
 *
 * @param header
 * @throws SOAPException
 */
// ***
public void extractFedCatInfo(SOAPHeader header) throws SOAPException {
  //Iterator iter = header.extractHeaderElements(Constants.SOAP_ACTOR);
  Iterator iter = header.examineHeaderElements(Constants.SOAP_ACTOR);
  deserializeFedCatInfos(iter);
}

代码示例来源:origin: net.sourceforge.addressing/addressing

/**
 * Removes all instances of all WSA headers for a given actor.
 *
 * @param soapHeader header container
 * @param actorURI   Actor URI
 */
public static void removeHeaders(SOAPHeader soapHeader, String actorURI) {
 if (soapHeader == null) {
  return;
 }
 Iterator<?> headers = soapHeader.examineHeaderElements(actorURI);
 List<SOAPHeaderElement> existingElements = new ArrayList<SOAPHeaderElement>();
 while (headers.hasNext()) {
  SOAPHeaderElement hElement = (SOAPHeaderElement) headers.next();
  Name hName = hElement.getElementName();
  AddressingVersion version = getAddressingVersion(hName.getURI());
  if (version != null) {
   existingElements.add(hElement);
  }
 }
 for (int i = 0; i < existingElements.size(); i++) {
  SOAPHeaderElement el = (SOAPHeaderElement) existingElements.get(i);
  el.detachNode();
 }
}

代码示例来源:origin: net.sourceforge.addressing/addressing

/**
 * Removes all instances of a given header name in WSA namespace for a given
 * actor.
 *
 * @param soapHeader Header containing the element to remove
 * @param actorURI   Actor URI
 * @param headerName element name
 */
public static void removeHeader(SOAPHeader soapHeader, String actorURI,
 String headerName) {
 if (soapHeader == null) {
  return;
 }
 Iterator<?> headers = soapHeader.examineHeaderElements(actorURI);
 List<SOAPHeaderElement> existingElements = new ArrayList<SOAPHeaderElement>();
 while (headers.hasNext()) {
  SOAPHeaderElement hElement = (SOAPHeaderElement) headers.next();
  Name hName = hElement.getElementName();
  if (isAddressingNamespaceURI(hName.getURI())
   && hName.getLocalName().equals(headerName)) {
   existingElements.add(hElement);
  }
 }
 for (int i = 0; i < existingElements.size(); i++) {
  SOAPHeaderElement el = (SOAPHeaderElement) existingElements.get(i);
  el.detachNode();
 }
}

代码示例来源:origin: org.mule.modules/mule-module-cxf

/**
 * Extracts Mule header properties from a Soap message
 * 
 * @param soapHeader
 */
public MuleSoapHeaders(SOAPHeader soapHeader)
{
  Iterator iter = soapHeader.examineHeaderElements(MULE_10_ACTOR);
  SOAPHeaderElement headerElement;
  while (iter.hasNext())
  {
    headerElement = (SOAPHeaderElement)iter.next();
    // checking that the elements are part of the mule namespace
    if (org.mule.util.StringUtils.equals(MULE_10_ACTOR, headerElement.getNamespaceURI()))
    {
      Iterator iter2 = headerElement.getChildElements();
      readElements(iter2);
    }
  }
}

代码示例来源:origin: org.mule.transports/mule-transport-soap

/**
 * Extracts Mule header properties from a Soap message
 * 
 * @param soapHeader
 */
public MuleSoapHeaders(SOAPHeader soapHeader)
{
  Iterator iter = soapHeader.examineHeaderElements(MULE_10_ACTOR);
  SOAPHeaderElement headerElement;
  while (iter.hasNext())
  {
    headerElement = (SOAPHeaderElement)iter.next();
    // checking that the elements are part of the mule namespace
    if (org.mule.util.StringUtils.equals(MULE_10_ACTOR, headerElement.getNamespaceURI()))
    {
      Iterator iter2 = headerElement.getChildElements();
      readElements(iter2);
    }
  }
}

代码示例来源:origin: net.sourceforge.addressing/addressing

Iterator<?> iter = header.examineHeaderElements(actorURI);

相关文章