wsdl4jExtensibilityElement = (ExtensibilityElement) iterator.next();
if (wsdl4jExtensibilityElement instanceof UnknownExtensibilityElement) {
UnknownExtensibilityElement unknown =
(UnknownExtensibilityElement) (wsdl4jExtensibilityElement);
QName type = unknown.getElementType();
// <wsp:Policy>
if (Constants.isPolicyElement(type)) {
if (isTraceEnabled) {
log.trace("copyExtensibleElements:: PolicyElement found " + unknown);
}
Policy policy = (Policy) PolicyUtil.getPolicyComponent(unknown.getElement());
description.getPolicySubject().attachPolicy(policy);
// int attachmentScope =
// getPolicyAttachmentPoint(description, originOfExtensibilityElements);
// if (attachmentScope > -1) {
// description.getPolicyInclude().addPolicyElement(
// attachmentScope, policy);
// }
// <wsp:PolicyReference>
} else if (Constants.isPolicyRef(type)) {
if (isTraceEnabled) {
log.trace("copyExtensibleElements:: PolicyReference found " + unknown);
}
PolicyReference policyReference = (PolicyReference) PolicyUtil
.getPolicyComponent(unknown.getElement());
description.getPolicySubject().attachPolicyReference(policyReference);
// int attachmentScope =
// getPolicyAttachmentPoint(description, originOfExtensibilityElements);
// if (attachmentScope > -1) {
// description.getPolicyInclude().addPolicyRefElement(
// attachmentScope, policyReference);
// }
} else if (AddressingConstants.Final.WSAW_USING_ADDRESSING
.equals(type)
|| AddressingConstants.Submission.WSAW_USING_ADDRESSING
.equals(unknown.getElementType())) {
if (isTraceEnabled) {
log.trace("copyExtensibleElements:: wsaw:UsingAddressing found " + unknown);
}
// FIXME We need to set this the appropriate Axis Description AxisEndpoint or
// AxisBinding .
if (originOfExtensibilityElements.equals(PORT)
|| originOfExtensibilityElements.equals(BINDING)) {
if (Boolean.TRUE.equals(unknown.getRequired())) {
AddressingHelper.setAddressingRequirementParemeterValue(axisService, AddressingConstants.ADDRESSING_REQUIRED);
} else {
AddressingHelper.setAddressingRequirementParemeterValue(axisService, AddressingConstants.ADDRESSING_OPTIONAL);
}
}
} else if (wsdl4jExtensibilityElement.getElementType() != null &&
wsdl4jExtensibilityElement.getElementType().getNamespaceURI().equals(
org.apache.axis2.namespace.Constants.FORMAT_BINDING)) {
Element typeMapping = unknown.getElement();
NodeList typeMaps = typeMapping.getElementsByTagNameNS(
org.apache.axis2.namespace.Constants.FORMAT_BINDING,
"typeMap");
int count = typeMaps.getLength();
HashMap typeMapper = new HashMap();
for (int index = 0; index < count; index++) {
Node node = typeMaps.item(index);
NamedNodeMap attributes = node.getAttributes();
Node typeName = attributes.getNamedItem("typeName");
if (typeName != null) {
String prefix = getPrefix(typeName.getNodeValue());
if (prefix != null) {
String ns = (String) wsdl4jDefinition.getNamespaces().get(prefix);
if (ns != null) {
Node formatType = attributes.getNamedItem("formatType");
typeMapper.put(new QName(ns, getTypeName(
typeName.getNodeValue())), formatType.getNodeValue());
}
}
}
}
} else if (wsdl4jExtensibilityElement.getElementType() != null &&
wsdl4jExtensibilityElement.getElementType().getNamespaceURI().equals(
org.apache.axis2.namespace.Constants.JAVA_NS)) {
Element unknowJavaElement = unknown.getElement();
if (unknowJavaElement.getLocalName().equals("address") ) {
NamedNodeMap nameAttributes = unknowJavaElement.getAttributes();
Node node = nameAttributes.getNamedItem("className");
Parameter serviceClass = new Parameter();
serviceClass.setName("className");