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

x33g5p2x  于2022-01-25 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(199)

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

Node.getValue介绍

[英]Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise. If there is an immediate child of this Node that it is a Text node then it's value will be returned. If there is more than one Text node then the value of the first Text Node will be returned. Otherwise null is returned.
[中]如果这是Text节点,则返回该节点的值,否则返回该节点的直接子节点的值。如果此Node的直接子节点是Text节点,则将返回其值。如果有多个Text节点,则将返回第一个Text节点的值。否则返回null

代码示例

代码示例来源:origin: stackoverflow.com

  1. while (it.hasNext()) {
  2. value = element.getValue();

代码示例来源:origin: org.switchyard.components/switchyard-component-soap

  1. /**
  2. * Get the WS-A MessageID from the envelope.
  3. *
  4. * @param soapEnvelope The SOAPEnvelope
  5. * @return The message id if found, null otehrwise
  6. * @throws SOAPException If the envelope could not be read
  7. */
  8. public static String getMessageID(SOAPEnvelope soapEnvelope) throws SOAPException {
  9. NodeList headers = soapEnvelope.getHeader().getElementsByTagNameNS(WSA_ACTION_QNAME.getNamespaceURI(), WSA_ACTION_QNAME.getLocalPart());
  10. if (headers.getLength() == 1) {
  11. return ((javax.xml.soap.Node)headers.item(0)).getValue();
  12. }
  13. return null;
  14. }

代码示例来源:origin: jboss-switchyard/components

  1. /**
  2. * Get the WS-A MessageID from the envelope.
  3. *
  4. * @param soapEnvelope The SOAPEnvelope
  5. * @return The message id if found, null otehrwise
  6. * @throws SOAPException If the envelope could not be read
  7. */
  8. public static String getMessageID(SOAPEnvelope soapEnvelope) throws SOAPException {
  9. NodeList headers = soapEnvelope.getHeader().getElementsByTagNameNS(WSA_ACTION_QNAME.getNamespaceURI(), WSA_ACTION_QNAME.getLocalPart());
  10. if (headers.getLength() == 1) {
  11. return ((javax.xml.soap.Node)headers.item(0)).getValue();
  12. }
  13. return null;
  14. }

代码示例来源:origin: se.skltp.mb/mb-intsvc

  1. private String extractTargetOrg(SOAPMessage soapMessage) throws SOAPException {
  2. // rivta2.0 uses To, 2.1 uses LogicalAddress
  3. Iterator iter = soapMessage.getSOAPHeader().getChildElements(TO_QNAME);
  4. if (!iter.hasNext()) {
  5. iter = soapMessage.getSOAPHeader().getChildElements(LOGICAL_ADDRESS_QNAME);
  6. }
  7. if (!iter.hasNext()) {
  8. throw new RuntimeException("No address node found in header!");
  9. }
  10. return ((Node)iter.next()).getValue();
  11. }

代码示例来源:origin: se.skltp.mb/mb-modules-intsvc

  1. private String extractTargetOrg(SOAPMessage soapMessage) throws SOAPException {
  2. // rivta2.0 uses To, 2.1 uses LogicalAddress
  3. Iterator iter = soapMessage.getSOAPHeader().getChildElements(TO_QNAME);
  4. if ( !iter.hasNext() ) {
  5. iter = soapMessage.getSOAPHeader().getChildElements(LOGICAL_ADDRESS_QNAME);
  6. }
  7. if ( !iter.hasNext() ) {
  8. throw new RuntimeException("No address node found in header!");
  9. }
  10. return ((Node) iter.next()).getValue();
  11. }

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

  1. Node node = (Node) iter.next();
  2. if (node.getLocalName() != null && node.getLocalName().equals(WsaConstants.EN_ADDRESS)) {
  3. wsaHeaders.add(new WsaReplyToHeader(node.getValue()));
  4. replyTo = true;

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

  1. Node node = (Node) iter.next();
  2. if (node.getLocalName() != null && node.getLocalName().equals(WsaConstants.EN_ADDRESS)) {
  3. wsaHeaders.add(new WsaReplyToHeader(node.getValue()));
  4. replyTo = true;

代码示例来源:origin: gooddata/GoodData-CL

  1. /**
  2. * Logs into the MS CRM 2011 Online
  3. *
  4. * @return the Live ID token
  5. * @throws JaxenException issue with the response format
  6. * @throws IOException generic IO issue
  7. * @throws SOAPException issue with SOAP invocation
  8. */
  9. public String login() throws IOException, SOAPException, JaxenException {
  10. String msg = FileUtil.readStringFromClasspath("/com/gooddata/msdynamics/LiveIdLogin.xml", MsDynamicsWrapper.class);
  11. msg = msg.replaceAll(LIVE_ID_SERVER_PLACEHOLDER, getHost());
  12. msg = msg.replaceAll(LIVE_ID_USERNAME_PLACEHOLDER, getUsername());
  13. msg = msg.replaceAll(LIVE_ID_PASSWORD_PLACEHOLDER, getPassword());
  14. msg = msg.replaceAll(LIVE_ID_POLICY_PLACEHOLDER, getPolicy());
  15. SOAPMessage response = soap.execute(HTTPS + LIVE_ID_HOST + LIVE_ID_ENDPOINT, msg);
  16. XPath xp = soap.createXPath("//wsse:BinarySecurityToken/text()", response);
  17. xp.addNamespace("wsse", WSSE_XMLNS);
  18. Node result = (Node) xp.selectSingleNode(response.getSOAPBody());
  19. return result.getValue();
  20. }

代码示例来源:origin: org.apache.axis2/axis2-saaj

  1. Node childSAAJNode = toSAAJNode(childNodes.item(i), saajEle);
  2. if (childSAAJNode instanceof javax.xml.soap.Text) {
  3. saajEle.addTextNode(childSAAJNode.getValue());
  4. } else {
  5. saajEle.addChildElement((javax.xml.soap.SOAPElement)childSAAJNode);

代码示例来源:origin: apache/axis2-java

  1. Node childSAAJNode = toSAAJNode(childNodes.item(i), saajEle);
  2. if (childSAAJNode instanceof javax.xml.soap.Text) {
  3. saajEle.addTextNode(childSAAJNode.getValue());
  4. } else {
  5. saajEle.addChildElement((javax.xml.soap.SOAPElement)childSAAJNode);

代码示例来源:origin: stackoverflow.com

  1. SOAPElement returnElement = (SOAPElement)responseElement.getChildElements().next();
  2. if(responseBody.getFault()!=null){
  3. System.out.println(returnElement.getValue()+" "+responseBody.getFault().getFaultString());
  4. } else {
  5. System.out.println(returnElement.getValue());

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

  1. String value = childNode.getValue();
  2. hrefElement.setValue(value);

相关文章