Search in sources :

Example 1 with ContextAwareMessageDispatcherProvider

use of org.mule.runtime.extension.api.soap.ContextAwareMessageDispatcherProvider in project mule by mulesoft.

the class ForwardingSoapClientConnectionProvider method validate.

@Override
public ConnectionValidationResult validate(ForwardingSoapClient connection) {
    try {
        serviceProvider.validateConfiguration();
        MessageDispatcher messageDispatcher;
        if (transportProvider instanceof ContextAwareMessageDispatcherProvider) {
            messageDispatcher = ((ContextAwareMessageDispatcherProvider) transportProvider).connect(new DefaultDispatchingContext(client));
        } else {
            messageDispatcher = transportProvider.connect();
        }
        ConnectionValidationResult result = transportProvider.validate(messageDispatcher, serviceProvider);
        transportProvider.disconnect(messageDispatcher);
        return result;
    } catch (Exception e) {
        return failure(e.getMessage(), e);
    }
}
Also used : MessageDispatcher(org.mule.runtime.extension.api.soap.message.MessageDispatcher) ConnectionValidationResult(org.mule.runtime.api.connection.ConnectionValidationResult) ContextAwareMessageDispatcherProvider(org.mule.runtime.extension.api.soap.ContextAwareMessageDispatcherProvider) InitialisationException(org.mule.runtime.api.lifecycle.InitialisationException) ConnectionException(org.mule.runtime.api.connection.ConnectionException) MuleException(org.mule.runtime.api.exception.MuleException) SoapServiceProviderConfigurationException(org.mule.runtime.extension.api.soap.SoapServiceProviderConfigurationException)

Aggregations

ConnectionException (org.mule.runtime.api.connection.ConnectionException)1 ConnectionValidationResult (org.mule.runtime.api.connection.ConnectionValidationResult)1 MuleException (org.mule.runtime.api.exception.MuleException)1 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)1 ContextAwareMessageDispatcherProvider (org.mule.runtime.extension.api.soap.ContextAwareMessageDispatcherProvider)1 SoapServiceProviderConfigurationException (org.mule.runtime.extension.api.soap.SoapServiceProviderConfigurationException)1 MessageDispatcher (org.mule.runtime.extension.api.soap.message.MessageDispatcher)1