Peter Frandsen created CXF-5789:
-----------------------------------
Summary: Add methods to get input and output SOAP headers to
SOAPBindingUtil
Key: CXF-5789
URL: https://issues.apache.org/jira/browse/CXF-5789
Project: CXF
Issue Type: Improvement
Affects Versions: 3.0.0
Reporter: Peter Frandsen
Priority: Minor
SOAPBindingUtil has methods to get the first input and output SOAP header for a
BindingOperation.
Add methods to get list of all the headers.
The method getSoapHeaders(List<ExtensibilityElement> exts) cannot be used as
the BindingOperation.getBindingInput().getExtensibilityElements() and
BindingOperation.getBindingOutput().getExtensibilityElements() returns
List<Object> and not List<ExtensibilityElement> which cannot safely be casted
to List<ExtensibilityElement> without checking the type of each element in the
list (...getExtensibilityElements() instanceof List<ExtensibilityElement> not
legal with Java generics).
{code:title=org.apache.cxf.binding.soap.SOAPBindingUtil|language=java}
public static List<SoapHeader> getBindingInputSOAPHeaders(BindingOperation
bop) {
List<SoapHeader> headers = new ArrayList<SoapHeader>();
BindingInput bindingInput = bop.getBindingInput();
if (bindingInput != null) {
for (Object obj : bindingInput.getExtensibilityElements()) {
if (isSOAPHeader(obj)) {
headers.add(getProxy(SoapHeader.class, obj));
}
}
}
return headers;
}
public static List<SoapHeader> getBindingOutputSOAPHeaders(BindingOperation
bop) {
List<SoapHeader> headers = new ArrayList<SoapHeader>();
BindingOutput bindingOutput = bop.getBindingOutput();
if (bindingOutput != null) {
for (Object obj : bindingOutput.getExtensibilityElements()) {
if (isSOAPHeader(obj)) {
headers.add(getProxy(SoapHeader.class, obj));
}
}
}
return headers;
}
{code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)