ExtensibilityElement wsdl4jElement = (ExtensibilityElement) iterator
.next();
if (wsdl4jElement instanceof UnknownExtensibilityElement) {
UnknownExtensibilityElement unknown = (UnknownExtensibilityElement) (wsdl4jElement);
//look for the SOAP 1.2 stuff here. WSDL4j does not understand SOAP 1.2 things
if (ExtensionConstants.SOAP_12_OPERATION.equals(unknown.getElementType())){
org.apache.wsdl.extensions.SOAPOperation soapOperationExtensibiltyElement = (org.apache.wsdl.extensions.SOAPOperation) extensionFactory
.getExtensionElement(wsdl4jElement.getElementType());
Element element = unknown.getElement();
soapOperationExtensibiltyElement.setSoapAction(element.getAttribute("soapAction"));
soapOperationExtensibiltyElement.setStyle(element.getAttribute("style"));
// soapActionRequired
component.addExtensibilityElement(soapOperationExtensibiltyElement);
}else if (ExtensionConstants.SOAP_12_BODY.equals(unknown.getElementType())){
org.apache.wsdl.extensions.SOAPBody soapBodyExtensibiltyElement = (org.apache.wsdl.extensions.SOAPBody) extensionFactory
.getExtensionElement(wsdl4jElement.getElementType());
Element element = unknown.getElement();
soapBodyExtensibiltyElement.setUse(element.getAttribute("use"));
soapBodyExtensibiltyElement.setNamespaceURI(element.getAttribute("namespace"));
//encoding style
component.addExtensibilityElement(soapBodyExtensibiltyElement);
}else if (ExtensionConstants.SOAP_12_HEADER.equals(unknown.getElementType())){
org.apache.wsdl.extensions.SOAPHeader soapHeaderExtensibilityElement = (org.apache.wsdl.extensions.SOAPHeader) extensionFactory.getExtensionElement(
unknown.getElementType());
//right now there's no known header binding!. Ignore the copying of values for now
component.addExtensibilityElement(soapHeaderExtensibilityElement);
}else if (ExtensionConstants.SOAP_12_BINDING.equals(unknown.getElementType())){
org.apache.wsdl.extensions.SOAPBinding soapBindingExtensibiltyElement = (org.apache.wsdl.extensions.SOAPBinding) extensionFactory
.getExtensionElement(wsdl4jElement.getElementType());
Element element = unknown.getElement();
soapBindingExtensibiltyElement.setTransportURI(element.getAttribute("transport"));
soapBindingExtensibiltyElement.setStyle(element.getAttribute("style"));
component.addExtensibilityElement(soapBindingExtensibiltyElement);
} else if (ExtensionConstants.SOAP_12_ADDRESS.equals(unknown.getElementType())){
org.apache.wsdl.extensions.SOAPAddress soapAddressExtensibiltyElement = (org.apache.wsdl.extensions.SOAPAddress) extensionFactory
.getExtensionElement(wsdl4jElement.getElementType());
Element element = unknown.getElement();
soapAddressExtensibiltyElement.setLocationURI(element.getAttribute("location"));
component.addExtensibilityElement(soapAddressExtensibiltyElement);
} else if (ExtensionConstants.POLICY.equals(unknown.getElementType())) {
PolicyExtensibilityElement policyExtensibilityElement = (PolicyExtensibilityElement) extensionFactory.getExtensionElement(wsdl4jElement.getElementType());
DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
policyExtensibilityElement.setPolicyElement(policyReader.readPolicy(unknown.getElement()));
component.addExtensibilityElement(policyExtensibilityElement);
} else if (ExtensionConstants.POLICY_REFERENCE.equals(unknown.getElementType())) {
PolicyExtensibilityElement policyExtensibilityElement = (PolicyExtensibilityElement) extensionFactory.getExtensionElement(wsdl4jElement.getElementType());
DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
policyExtensibilityElement.setPolicyElement(policyReader.readPolicyReference(unknown.getElement()));
component.addExtensibilityElement(policyExtensibilityElement);
}else{
DefaultExtensibilityElement defaultExtensibilityElement = (DefaultExtensibilityElement) extensionFactory
.getExtensionElement(wsdl4jElement.getElementType());
defaultExtensibilityElement.setElement(unknown.getElement());
Boolean required = unknown.getRequired();
if (null != required) {
defaultExtensibilityElement.setRequired(required.booleanValue());
}
component.addExtensibilityElement(defaultExtensibilityElement);
}