soapHeaders.add(headerMessage);
}
} else if (wsdl4jExtensibilityElement instanceof SOAPHeader) {
SOAPHeader soapHeader = (SOAPHeader) wsdl4jExtensibilityElement;
SOAPHeaderMessage headerMessage = new SOAPHeaderMessage();
headerMessage.setNamespaceURI(soapHeader.getNamespaceURI());
headerMessage.setUse(soapHeader.getUse());
Boolean required = soapHeader.getRequired();
if (null != required) {
headerMessage.setRequired(required.booleanValue());
}
if (null != wsdl4jDefinition) {
// find the relevant schema part from the messages
Message msg = wsdl4jDefinition.getMessage(soapHeader
.getMessage());
if (msg == null) {
msg = getMessage(wsdl4jDefinition, soapHeader
.getMessage(), new HashSet());
}
if (msg == null) {
// todo i18n this
throw new AxisFault("message "
+ soapHeader.getMessage()
+ " not found in the WSDL ");
}
Part msgPart = msg.getPart(soapHeader.getPart());
if (msgPart == null) {
// todo i18n this
throw new AxisFault("message part "
+ soapHeader.getPart()
+ " not found in the WSDL ");
}
headerMessage.setElement(msgPart.getElementName());
}
headerMessage.setMessage(soapHeader.getMessage());
headerMessage.setPart(soapHeader.getPart());
if (description instanceof AxisBindingMessage) {
AxisBindingMessage bindingMessage = (AxisBindingMessage) description;
List soapHeaders =
(List) bindingMessage.getProperty(WSDL2Constants.ATTR_WSOAP_HEADER);