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);
}
}
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);
}
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");
}
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());
}
}
}
Aggregations