@Override protected boolean validateLookupKey(String key) { return QNameUtils.validateQName(key); }
@Override protected boolean validateLookupKey(String key) { return QNameUtils.validateQName(key); }
@Override protected boolean validateLookupKey(String key) { return QNameUtils.validateQName(key); }
@Override protected boolean validateLookupKey(String key) { return QNameUtils.validateQName(key); }
/** * Default constructor using fields. */ public RootQNameMessageSelector(String name, String value, TestContext context) { super(name, value, context); Assert.isTrue(selectKey.equals(SELECTOR_ID), String.format("Invalid usage of root QName message selector - " + "usage restricted to key '%s' but was '%s'", SELECTOR_ID, selectKey)); if (QNameUtils.validateQName(value)) { this.rootQName = QNameUtils.parseQNameString(value); } else { throw new CitrusRuntimeException("Invalid root QName string '" + value + "'"); } }
@Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); org.springframework.ws.soap.SoapHeader soapHeader = request.getSoapHeader(); String paramValue = parameter.getParameterAnnotation(SoapHeader.class).value(); Assert.isTrue(QNameUtils.validateQName(paramValue), "Invalid header qualified name [" + paramValue + "]. " + "QName must be of the form '{namespace}localPart'."); QName qname = QName.valueOf(paramValue); Class<?> parameterType = parameter.getParameterType(); if (SoapHeaderElement.class.equals(parameterType)) { return extractSoapHeader(qname, soapHeader); } else if (List.class.equals(parameterType)) { return extractSoapHeaderList(qname, soapHeader); } // should not happen throw new UnsupportedOperationException(); }
private void copySoapHeaders(final WebServiceEndpointConfiguration endpointConfiguration, final org.springframework.ws.soap.SoapMessage soapRequest, final SoapMessage soapMessage) { for (final Entry<String, Object> headerEntry : soapMessage.getHeaders().entrySet()) { if (MessageHeaderUtils.isSpringInternalHeader(headerEntry.getKey())) { continue; } if (headerEntry.getKey().equalsIgnoreCase(SoapMessageHeaders.SOAP_ACTION)) { soapRequest.setSoapAction(headerEntry.getValue().toString()); } else if (headerEntry.getKey().toLowerCase().startsWith(SoapMessageHeaders.HTTP_PREFIX)) { handleOutboundMimeMessageHeader(soapRequest, headerEntry.getKey().substring(SoapMessageHeaders.HTTP_PREFIX.length()), headerEntry.getValue(), endpointConfiguration.isHandleMimeHeaders()); } else if (!headerEntry.getKey().startsWith(MessageHeaders.PREFIX)) { final SoapHeaderElement headerElement; if (QNameUtils.validateQName(headerEntry.getKey())) { headerElement = soapRequest.getSoapHeader().addHeaderElement(QNameUtils.parseQNameString(headerEntry.getKey())); } else { headerElement = soapRequest.getSoapHeader().addHeaderElement(new QName("", headerEntry.getKey(), "")); } headerElement.setText(headerEntry.getValue().toString()); } } }
public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); org.springframework.ws.soap.SoapHeader soapHeader = request.getSoapHeader(); String paramValue = parameter.getParameterAnnotation(SoapHeader.class).value(); Assert.isTrue(QNameUtils.validateQName(paramValue), "Invalid header qualified name [" + paramValue + "]. " + "QName must be of the form '{namespace}localPart'."); QName qname = QName.valueOf(paramValue); Class<?> parameterType = parameter.getParameterType(); if (SoapHeaderElement.class.equals(parameterType)) { return extractSoapHeader(qname, soapHeader); } else if (List.class.equals(parameterType)) { return extractSoapHeaderList(qname, soapHeader); } // should not happen throw new UnsupportedOperationException(); }
@Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); org.springframework.ws.soap.SoapHeader soapHeader = request.getSoapHeader(); String paramValue = parameter.getParameterAnnotation(SoapHeader.class).value(); Assert.isTrue(QNameUtils.validateQName(paramValue), "Invalid header qualified name [" + paramValue + "]. " + "QName must be of the form '{namespace}localPart'."); QName qname = QName.valueOf(paramValue); Class<?> parameterType = parameter.getParameterType(); if (SoapHeaderElement.class.equals(parameterType)) { return extractSoapHeader(qname, soapHeader); } else if (List.class.equals(parameterType)) { return extractSoapHeaderList(qname, soapHeader); } // should not happen throw new UnsupportedOperationException(); }
@Override public Object resolveArgument(MessageContext messageContext, MethodParameter parameter) throws Exception { Assert.isInstanceOf(SoapMessage.class, messageContext.getRequest()); SoapMessage request = (SoapMessage) messageContext.getRequest(); org.springframework.ws.soap.SoapHeader soapHeader = request.getSoapHeader(); String paramValue = parameter.getParameterAnnotation(SoapHeader.class).value(); Assert.isTrue(QNameUtils.validateQName(paramValue), "Invalid header qualified name [" + paramValue + "]. " + "QName must be of the form '{namespace}localPart'."); QName qname = QName.valueOf(paramValue); Class<?> parameterType = parameter.getParameterType(); if (SoapHeaderElement.class.equals(parameterType)) { return extractSoapHeader(qname, soapHeader); } else if (List.class.equals(parameterType)) { return extractSoapHeaderList(qname, soapHeader); } // should not happen throw new UnsupportedOperationException(); }
} else if (!headerEntry.getKey().startsWith(MessageHeaders.PREFIX)) { SoapHeaderElement headerElement; if (QNameUtils.validateQName(headerEntry.getKey())) { QName qname = QNameUtils.parseQNameString(headerEntry.getKey());