Java Code Examples for javax.xml.soap.SOAPHeaderElement#addTextNode()

The following examples show how to use javax.xml.soap.SOAPHeaderElement#addTextNode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RelatesToHeader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 2
Source File: RelatesToHeader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 3
Source File: VersionHandler.java    From development with Apache License 2.0 5 votes vote down vote up
/**
 * The method is invoked for normal processing of outbound messages.
 * 
 * @param context
 *            the message context.
 * @return An indication of whether handler processing should continue for
 *         the current message. Return <code>true</code> to continue
 *         processing.
 * 
 * @throws Exception
 *             Causes the JAX-WS runtime to cease fault message processing.
 **/
@Override
public boolean handleMessage(SOAPMessageContext context) {
    Boolean request_p = (Boolean) context
            .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    if (request_p.booleanValue()) {
        try {
            SOAPMessage msg = context.getMessage();
            SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
            SOAPHeader hdr = env.getHeader();
            if (hdr == null) {
                hdr = env.addHeader();
            }
            QName qname_user = new QName("http://com/auth/", "auth");
            SOAPHeaderElement helem_user = hdr.addHeaderElement(qname_user);
            helem_user.setActor(VERSION);
            if (version == null || version.trim().length() == 0) {
                helem_user.addTextNode(apiVersionInfo.getProperty(VERSION));
            } else {
                helem_user.addTextNode(version);
            }

            msg.saveChanges();
            message = soapMessage2String(msg);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    return true;
}
 
Example 4
Source File: StringHeader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);
    if(mustUnderstand) {
        she.setMustUnderstand(true);
    }
    she.addTextNode(value);
}
 
Example 5
Source File: FaultDetailHeader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(av.faultDetailTag);
    she = header.addHeaderElement(new QName(av.nsUri, wrapper));
    she.addTextNode(problemValue);
}
 
Example 6
Source File: RelatesToHeader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 7
Source File: RelatesToHeader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 8
Source File: StringHeader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);
    if(mustUnderstand) {
        she.setMustUnderstand(true);
    }
    she.addTextNode(value);
}
 
Example 9
Source File: FaultDetailHeader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(av.faultDetailTag);
    she = header.addHeaderElement(new QName(av.nsUri, wrapper));
    she.addTextNode(problemValue);
}
 
Example 10
Source File: RelatesToHeader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 11
Source File: RelatesToHeader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 12
Source File: StringHeader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);
    if(mustUnderstand) {
        she.setMustUnderstand(true);
    }
    she.addTextNode(value);
}
 
Example 13
Source File: FaultDetailHeader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(av.faultDetailTag);
    she = header.addHeaderElement(new QName(av.nsUri, wrapper));
    she.addTextNode(problemValue);
}
 
Example 14
Source File: RelatesToHeader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 15
Source File: ProblemActionHeader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(new QName(getNamespaceURI(), getLocalPart()));
    she.addChildElement(actionLocalName);
    she.addTextNode(action);
    if (soapAction != null) {
        she.addChildElement(soapActionLocalName);
        she.addTextNode(soapAction);
    }
}
 
Example 16
Source File: StringHeader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);
    if(mustUnderstand) {
        she.setMustUnderstand(true);
    }
    she.addTextNode(value);
}
 
Example 17
Source File: ProblemActionHeader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(new QName(getNamespaceURI(), getLocalPart()));
    she.addChildElement(actionLocalName);
    she.addTextNode(action);
    if (soapAction != null) {
        she.addChildElement(soapActionLocalName);
        she.addTextNode(soapAction);
    }
}
 
Example 18
Source File: RelatesToHeader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if (header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);

    if (type != null)
        she.addAttribute(typeAttributeName, type);
    she.addTextNode(value);
}
 
Example 19
Source File: StringHeader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);
    if(mustUnderstand) {
        she.setMustUnderstand(true);
    }
    she.addTextNode(value);
}
 
Example 20
Source File: StringHeader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void writeTo(SOAPMessage saaj) throws SOAPException {
    SOAPHeader header = saaj.getSOAPHeader();
    if(header == null)
        header = saaj.getSOAPPart().getEnvelope().addHeader();
    SOAPHeaderElement she = header.addHeaderElement(name);
    if(mustUnderstand) {
        she.setMustUnderstand(true);
    }
    she.addTextNode(value);
}