return message.getDocument();
}
private void addHeaders(SoapMessageBuilder.EnvelopeBuilder envelope, Action action, ResourceURI resourceURI, OptionSet optionSet)
throws URISyntaxException {
HeaderBuilder header = envelope.header();
header.to(targetURL.toURI()).replyTo(new URI("http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"));
header.maxEnvelopeSize(winRmEnvelopSize);
header.withId(getUUID());
header.withLocale(winRmLocale);
header.withTimeout(winRmTimeout);
header.withAction(action.getUri());
if (shellId != null) {
header.withShellId(shellId);
}
header.withResourceURI(resourceURI.getUri());
if (optionSet != null) {
header.withOptionSet(optionSet.getKeyValuePairs());
}
}