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

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

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

SOAPHeader.detachNode介绍

暂无

代码示例

代码示例来源:origin: com.github.shiver-me-timbers/smt-webservice-stub-client

private void addHeaders(Document document, SOAPHeader soapHeader, Set<SoapHeader> headers) {
    if (headers.isEmpty()) {
      soapHeader.detachNode(); // Clean up the empty header tag.
      return;
    }
    final String namespace = soapHeaders.extractNamespace(document);
    headers.forEach(header -> soapHeaders.addHeader(soapHeader, namespace, header));
  }
}

代码示例来源:origin: org.jibx.schema.ws/org.jibx.schema.ws.client

/**
 * Create a SOAP message with this jibx message in it.
 * @param jibxMessage
 * @return
 * @throws SOAPException
 */
public static SOAPMessage createSOAPMessage(Object jibxMessage) throws SOAPException
{
  SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
  SOAPHeader header = soapMessage.getSOAPHeader();
  header.detachNode();
  SOAPBody body = soapMessage.getSOAPBody();
  
  DOMResult result = new DOMResult(body);
  Element resElement = marshalObjectToDOM(jibxMessage);
  DOMSource source = new DOMSource(resElement);
  copyTreeToResult(source, result);
  return soapMessage;
}
/**

代码示例来源:origin: org.jibx.schema.org.opentravel._2012A.ws/org.jibx.schema.org.opentravel.ws.client.test

/**
 * Create a SOAP message with this jibx message in it.
 * @param jibxMessage
 * @return
 * @throws SOAPException
 */
public static SOAPMessage createSOAPMessage(Object jibxMessage) throws SOAPException
{
  SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
  SOAPHeader header = soapMessage.getSOAPHeader();
  header.detachNode();
  SOAPBody body = soapMessage.getSOAPBody();
  
  DOMResult result = new DOMResult(body);
  Element resElement = marshalObjectToDOM(jibxMessage);
  DOMSource source = new DOMSource(resElement);
  copyTreeToResult(source, result);
  return soapMessage;
}
/**

代码示例来源:origin: org.apache.juddi.scout/scout

private SOAPMessage createSOAPMessage(Element elem) throws Exception {
  String prefix = "";
  MessageFactory msgFactory = MessageFactory.newInstance();
  SOAPFactory factory = SOAPFactory.newInstance();
  SOAPMessage message = msgFactory.createMessage();
  message.getSOAPHeader().detachNode();
  SOAPPart soapPart = message.getSOAPPart();
  SOAPBody soapBody = soapPart.getEnvelope().getBody();
  //Create the outer body element
  Name bodyName = factory.createName(elem.getNodeName(), prefix, UDDI_V2_NAMESPACE);
  SOAPBodyElement bodyElement = soapBody.addBodyElement(bodyName);
  bodyElement.addNamespaceDeclaration(prefix, UDDI_V2_NAMESPACE);
  appendAttributes(bodyElement, elem.getAttributes(), factory);
  appendElements(bodyElement, elem.getChildNodes(), factory);
  return message;
}

代码示例来源:origin: com.betfair.cougar/cougar-component-code-tests

envelope.getHeader().detachNode();
SOAPHeader soapHeader = envelope.addHeader();

代码示例来源:origin: com.betfair.cougar/cougar-test-utils

envelope.getHeader().detachNode();

代码示例来源:origin: org.n52.svalbard/svalbard-xmlbeans

soapResponseMessage.getSOAPHeader().detachNode();

代码示例来源:origin: org.n52.sensorweb.sos/binding-soap

soapResponseMessage.getSOAPHeader().detachNode();

相关文章