Dispatch client fails to set WS-Addressing Action header when WSDL's
soap:operation does not have a style attribute
-------------------------------------------------------------------------------------------------------------------
Key: CXF-3747
URL: https://issues.apache.org/jira/browse/CXF-3747
Project: CXF
Issue Type: Bug
Components: JAX-WS Runtime
Affects Versions: 2.4.1
Reporter: Jesse Pangburn
Priority: Minor
I found the cause of the problem to be a bug in this method in CXF (I have
version 2.4.1):
private Map<String, QName> createPayloadEleOpNameMap(BindingInfo
bindingInfo) {
Map<String, QName> payloadElementMap = new java.util.HashMap<String,
QName>();
for (BindingOperationInfo bop : bindingInfo.getOperations()) {
SoapOperationInfo soi =
(SoapOperationInfo)bop.getExtensor(SoapOperationInfo.class);
if (soi != null) {
if ("document".equals(soi.getStyle())) {
// if doc
if (bop.getOperationInfo().getInput() != null
&&
!bop.getOperationInfo().getInput().getMessageParts().isEmpty()) {
QName qn =
bop.getOperationInfo().getInput().getMessagePartByIndex(0)
.getElementQName();
payloadElementMap.put(qn.toString(),
bop.getOperationInfo().getName());
}
} else if ("rpc".equals(soi.getStyle())) {
// if rpc
payloadElementMap.put(bop.getOperationInfo().getName().toString(),
bop.getOperationInfo()
.getName());
}
}
}
return payloadElementMap;
}
The problem is that it requires the SoapOperationInfo to have a style
attribute, but in the W3C spec for WSDL it says the style attribute on the soap
operation is optional, specifically 'If the attribute is not specified, it
defaults to the value specified in the soap:binding element. If the
soap:binding element does not specify a style, it is assumed to be "document".'
So the code needs to check if the soi has a style and if not read it from the
binding and if not then set it as "document". This is not a problem in the
WSDLs generated by CXF (as I found out with a HelloWorld test) because it
creates these optional style attributes, but since W3C says people can generate
WSDLs without these (and I ran into one) I think it's worth fixing.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira