private NextAction handleMakeConnectionRequest(Packet request, String clientUID) {
try {
LOGGER.entering();
MakeConnectionElement mcElement;
try {
mcElement = request.getMessage().readPayloadAsJAXB(configuration.getRuntimeVersion().getUnmarshaller(configuration.getAddressingVersion()));
} catch (JAXBException ex) {
throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0107_ERROR_UNMARSHALLING_PROTOCOL_MESSAGE(), ex));
}
if (mcElement.getAddress() == null) {
// WS-I RSP v1.0: R2102 If a wsmc:MakeConnection request does not contain a wsmc:Address child element
// (in violation of R2100), the MC-RECEIVER MUST generate a wsmc:MissingSelection fault.
return super.doReturnWith(createSoapFaultResponse(
request,
configuration.getSoapVersion(),
configuration.getAddressingVersion(),
configuration.getRuntimeVersion().protocolVersion.wsmcFaultAction,
configuration.getSoapVersion().faultCodeServer,
configuration.getRuntimeVersion().protocolVersion.missingSelectionFaultCode,
"The MakeConnection element did not contain any selection criteria.",
null));
}
if (!mcElement.getAny().isEmpty()) {
// WS-I RSP v1.0: R2103 If a wsmc:MakeConnection request contains a wsrm:Identifier element
// (in violation of R2101) the MC-RECEIVER MUST generate a wsmc:UnsupportedSelection fault.
List<SoapFaultDetailEntry> unsupportedSelections = new ArrayList<SoapFaultDetailEntry>(mcElement.getAny().size());
for (Object element : mcElement.getAny()) {
if (element instanceof Node) {
Node selectionNode = ((Node) element);
unsupportedSelections.add(new SoapFaultDetailEntry(
configuration.getRuntimeVersion().protocolVersion.unsupportedSelectionFaultCode,
new QName(selectionNode.getNamespaceURI(), selectionNode.getLocalName()).toString()));
}
}
return super.doReturnWith(createSoapFaultResponse(
request,
configuration.getSoapVersion(),
configuration.getAddressingVersion(),
configuration.getRuntimeVersion().protocolVersion.wsmcFaultAction,
configuration.getSoapVersion().faultCodeServer,
configuration.getRuntimeVersion().protocolVersion.unsupportedSelectionFaultCode,
"The extension element used in the message selection is not supported by the MakeConnection receiver.",
unsupportedSelections));
}
String selectionUID = configuration.getRuntimeVersion().getClientId(mcElement.getAddress().getValue());
if (selectionUID == null) {
// TODO return a MissingSelection SOAP fault
throw LOGGER.logSevereException(new RxRuntimeException(LocalizationMessages.WSMC_0108_NULL_SELECTION_ADDRESS()));
}