el.setRequired(addressing.required());
bindingInfo.addExtensor(el);
StringBuilder polRefId = new StringBuilder(bindingInfo.getName().getLocalPart());
polRefId.append("_WSAM_Addressing_Policy");
UnknownExtensibilityElement uel = new UnknownExtensibilityElement();
W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
writer.writeStartElement("wsp", "PolicyReference", URI_POLICY_NS);
writer.writeAttribute("URI", "#" + polRefId.toString());
writer.writeEndElement();
Element pr = writer.getDocument().getDocumentElement();
uel.setElement(pr);
uel.setElementType(DOMUtils.getElementQName(pr));
bindingInfo.addExtensor(uel);
writer = new W3CDOMStreamWriter();
writer.writeStartElement("wsp", "Policy", URI_POLICY_NS);
writer.writeAttribute("wsu", URI_WSU_NS,
"Id", polRefId.toString());
writer.writeStartElement("wsam", "Addressing", JAXWSAConstants.NS_WSAM);
if (!addressing.required()) {
writer.writeAttribute("wsp", URI_POLICY_NS,
"Optional", "true");
}
writer.writeStartElement("wsp", "Policy", URI_POLICY_NS);
String s = getAddressingRequirement(addressing);
if (s != null) {
writer.writeEmptyElement("wsam", s, JAXWSAConstants.NS_WSAM);
}
writer.writeEndElement();
writer.writeEndElement();
writer.writeEndElement();
pr = writer.getDocument().getDocumentElement();
uel = new UnknownExtensibilityElement();
uel.setElement(pr);
uel.setElementType(DOMUtils.getElementQName(pr));
if (bindingInfo.getService().getDescription() == null) {
DescriptionInfo description = new DescriptionInfo();
description.setName(bindingInfo.getService().getName());
bindingInfo.getService().setDescription(description);
}