addSoapBodyPart(msg, bodyParts, partName);
}
} else if (SOAPBindingUtil.isSOAPHeader(content)) {
SoapHeader header = SOAPBindingUtil.getSoapHeader(content);
SoapHeaderInfo headerInfo = new SoapHeaderInfo();
headerInfo.setUse(header.getUse());
if (StringUtils.isEmpty(header.getPart())) {
throw new RuntimeException("Problem with WSDL: soap:header element in operation "
+ bmsg.getBindingOperation().getName().getLocalPart()
+ " does not specify a part.");
}
MessagePartInfo mpi =
msg.getMessagePart(new QName(msg.getName().getNamespaceURI(),
header.getPart()));
if (mpi != null && header.getMessage() != null
&& !mpi.getMessageInfo().getName().equals(header.getMessage())) {
mpi = null;
//out of band, let's find it
for (MessagePartInfo mpi2 : msg.getOutOfBandParts()) {
if (mpi2.getName().getLocalPart().equals(header.getPart())
&& mpi2.getMessageInfo().getName().equals(header.getMessage())) {
mpi = mpi2;
}
}
}
if (mpi != null) {
headerInfo.setPart(mpi);
messageParts.remove(mpi);
bmsg.getMessageParts().remove(mpi);
bmsg.addExtensor(headerInfo);
}
}