// compare soap versions and respond appropriately under SOAP 1.2 Appendix 'A'
Collection<EndpointDescription> eds = serviceDesc.getEndpointDescriptions_AsCollection();
// dispatch endpoints do not have SEIs, so watch out for null or empty array
if ((eds != null) && (eds.size() > 0)) {
EndpointDescription ed = eds.iterator().next();
Protocol protocol = requestMsgCtx.getMessage().getProtocol();
String endpointBindingType = ed.getBindingType();
if (protocol.equals(Protocol.soap11)) {
return (SOAPBinding.SOAP11HTTP_BINDING.equalsIgnoreCase(endpointBindingType)) ||
(SOAPBinding.SOAP11HTTP_MTOM_BINDING.equalsIgnoreCase(endpointBindingType));
} else if (protocol.equals(Protocol.soap12)) {
return (SOAPBinding.SOAP12HTTP_BINDING.equalsIgnoreCase(endpointBindingType)) ||
(SOAPBinding.SOAP12HTTP_MTOM_BINDING.equalsIgnoreCase(endpointBindingType));
} else if (protocol.equals(Protocol.rest)) {
return HTTPBinding.HTTP_BINDING.equalsIgnoreCase(endpointBindingType);
}
}
// safe to assume?
return true;