}
return false;
}
private void buildWsdlExtensibilities(BindingInfo bindingInfo) {
Addressing addressing = getAddressing();
if (addressing != null) {
ExtensionRegistry extensionRegistry = getBus().getExtension(WSDLManager.class)
.getExtensionRegistry();
try {
ExtensibilityElement el = extensionRegistry.createExtension(javax.wsdl.Binding.class,
JAXWSAConstants.
WSAW_USINGADDRESSING_QNAME);
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", PolicyConstants.NAMESPACE_WS_POLICY);
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", PolicyConstants.NAMESPACE_WS_POLICY);
writer.writeAttribute("wsu", PolicyConstants.WSU_NAMESPACE_URI,
PolicyConstants.WSU_ID_ATTR_NAME, polRefId.toString());
writer.writeStartElement("wsam", "Addressing", JAXWSAConstants.NS_WSAM);
if (!addressing.required()) {
writer.writeAttribute("wsp", PolicyConstants.NAMESPACE_WS_POLICY,
"Optional", "true");
}
writer.writeStartElement("wsp", "Policy", PolicyConstants.NAMESPACE_WS_POLICY);