Search in sources :

Example 11 with MessageHeaders

use of com.sun.xml.ws.api.message.MessageHeaders in project metro-jax-ws by eclipse-ee4j.

the class AsyncClientTransportTube method setNonAnnonymousReplyTo.

void setNonAnnonymousReplyTo(Message m, AddressingVersion av, Header nonAnonymousHeader) {
    MessageHeaders headers = m.getHeaders();
    headers.remove(av.replyToTag);
    headers.add(nonAnonymousHeader);
    if (headers.remove(av.faultToTag) != null) {
        headers.add(nonAnonymousHeader);
    }
}
Also used : MessageHeaders(com.sun.xml.ws.api.message.MessageHeaders)

Example 12 with MessageHeaders

use of com.sun.xml.ws.api.message.MessageHeaders in project metro-jax-ws by eclipse-ee4j.

the class AbstractMessageImpl method writeToBodyStart.

public void writeToBodyStart(XMLStreamWriter w) throws XMLStreamException {
    String soapNsUri = soapVersion.nsUri;
    w.writeStartDocument();
    w.writeStartElement("S", "Envelope", soapNsUri);
    w.writeNamespace("S", soapNsUri);
    if (hasHeaders()) {
        w.writeStartElement("S", "Header", soapNsUri);
        MessageHeaders headers = getHeaders();
        for (Header h : headers.asList()) {
            h.writeTo(w);
        }
        w.writeEndElement();
    }
    // write the body
    w.writeStartElement("S", "Body", soapNsUri);
}
Also used : Header(com.sun.xml.ws.api.message.Header) MessageHeaders(com.sun.xml.ws.api.message.MessageHeaders)

Example 13 with MessageHeaders

use of com.sun.xml.ws.api.message.MessageHeaders in project metro-jax-ws by eclipse-ee4j.

the class AbstractMessageImpl method writeTo.

/**
 * Writes the whole envelope as SAX events.
 */
@Override
public void writeTo(ContentHandler contentHandler, ErrorHandler errorHandler) throws SAXException {
    String soapNsUri = soapVersion.nsUri;
    contentHandler.setDocumentLocator(NULL_LOCATOR);
    contentHandler.startDocument();
    contentHandler.startPrefixMapping("S", soapNsUri);
    contentHandler.startElement(soapNsUri, "Envelope", "S:Envelope", EMPTY_ATTS);
    if (hasHeaders()) {
        contentHandler.startElement(soapNsUri, "Header", "S:Header", EMPTY_ATTS);
        MessageHeaders headers = getHeaders();
        for (Header h : headers.asList()) {
            h.writeTo(contentHandler, errorHandler);
        }
        contentHandler.endElement(soapNsUri, "Header", "S:Header");
    }
    // write the body
    contentHandler.startElement(soapNsUri, "Body", "S:Body", EMPTY_ATTS);
    writePayloadTo(contentHandler, errorHandler, true);
    contentHandler.endElement(soapNsUri, "Body", "S:Body");
    contentHandler.endElement(soapNsUri, "Envelope", "S:Envelope");
}
Also used : Header(com.sun.xml.ws.api.message.Header) MessageHeaders(com.sun.xml.ws.api.message.MessageHeaders)

Example 14 with MessageHeaders

use of com.sun.xml.ws.api.message.MessageHeaders in project metro-jax-ws by eclipse-ee4j.

the class Stub method configureRequestPacket.

private void configureRequestPacket(Packet packet, RequestContext requestContext) {
    // fill in Packet
    packet.proxy = this;
    packet.handlerConfig = binding.getHandlerConfig();
    // to make it multi-thread safe we need to first get a stable snapshot
    Header[] hl = userOutboundHeaders;
    if (hl != null) {
        MessageHeaders mh = packet.getMessage().getHeaders();
        for (Header h : hl) {
            mh.add(h);
        }
    }
    requestContext.fill(packet, (binding.getAddressingVersion() != null));
    packet.addSatellite(wsdlProperties);
    if (addrVersion != null) {
        // populate request WS-Addressing headers
        MessageHeaders headerList = packet.getMessage().getHeaders();
        AddressingUtils.fillRequestAddressingHeaders(headerList, wsdlPort, binding, packet);
        // Current approach: Add ReferenceParameters only if addressing enabled.
        if (endpointReference != null) {
            endpointReference.addReferenceParametersToList(packet.getMessage().getHeaders());
        }
    }
}
Also used : Header(com.sun.xml.ws.api.message.Header) MessageHeaders(com.sun.xml.ws.api.message.MessageHeaders)

Aggregations

MessageHeaders (com.sun.xml.ws.api.message.MessageHeaders)14 Header (com.sun.xml.ws.api.message.Header)10 SAAJMessageHeaders (com.sun.xml.ws.api.message.saaj.SAAJMessageHeaders)5 QName (javax.xml.namespace.QName)5 StringHeader (com.sun.xml.ws.message.StringHeader)4 SOAPMessage (jakarta.xml.soap.SOAPMessage)4 NotNull (com.sun.istack.NotNull)2 Message (com.sun.xml.ws.api.message.Message)2 TagInfoset (com.sun.xml.ws.encoding.TagInfoset)2 InvalidAddressingHeaderException (com.sun.xml.ws.addressing.model.InvalidAddressingHeaderException)1 Packet (com.sun.xml.ws.api.message.Packet)1 WSDLOperationMapping (com.sun.xml.ws.api.model.WSDLOperationMapping)1 FaultDetailHeader (com.sun.xml.ws.message.FaultDetailHeader)1 StreamHeader11 (com.sun.xml.ws.message.stream.StreamHeader11)1 SOAPFault (jakarta.xml.soap.SOAPFault)1 SOAPHeaderElement (jakarta.xml.soap.SOAPHeaderElement)1 WebServiceException (jakarta.xml.ws.WebServiceException)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 XMLStreamReader (javax.xml.stream.XMLStreamReader)1