use of org.mule.runtime.soap.api.client.SoapClient in project mule by mulesoft.
the class InvokeOutputTypeResolver method getOutputType.
/**
* {@inheritDoc}
*/
@Override
public MetadataType getOutputType(MetadataContext context, WebServiceTypeKey key) throws MetadataResolvingException, ConnectionException {
SoapClient client = getClient(context, key);
SoapOperationMetadata metadata = client.getMetadataResolver().getOutputMetadata(key.getOperation());
return buildOutputType(metadata.getBodyType(), metadata.getHeadersType(), metadata.getAttachmentsType(), context.getTypeBuilder());
}
use of org.mule.runtime.soap.api.client.SoapClient in project mule by mulesoft.
the class InvokeRequestTypeResolver method getInputMetadata.
/**
* {@inheritDoc}
*/
@Override
public MetadataType getInputMetadata(MetadataContext context, WebServiceTypeKey key) throws MetadataResolvingException, ConnectionException {
SoapClient client = getClient(context, key);
SoapOperationMetadata metadata = client.getMetadataResolver().getInputMetadata(key.getOperation());
return metadata.getBodyType();
}
use of org.mule.runtime.soap.api.client.SoapClient in project mule by mulesoft.
the class InvokeInputHeadersTypeResolver method getInputMetadata.
/**
* {@inheritDoc}
*/
@Override
public MetadataType getInputMetadata(MetadataContext context, WebServiceTypeKey key) throws MetadataResolvingException, ConnectionException {
SoapClient client = getClient(context, key);
SoapOperationMetadata metadata = client.getMetadataResolver().getInputMetadata(key.getOperation());
return metadata.getHeadersType();
}
use of org.mule.runtime.soap.api.client.SoapClient in project mule by mulesoft.
the class ForwardingSoapClientTestCase method loadClient.
@Test
public void loadClient() throws Exception {
SoapClient sc = client.getSoapClient("uno");
SoapResponse response = sc.consume(SoapRequest.empty("no-op"));
assertThat(IOUtils.toString(response.getContent()), is("Content"));
}
use of org.mule.runtime.soap.api.client.SoapClient in project mule by mulesoft.
the class SoapOperationExecutor method execute.
/**
* {@inheritDoc}
*/
@Override
public Publisher<Object> execute(ExecutionContext<OperationModel> context) {
try {
String serviceId = context.getParameter(SERVICE_PARAM);
ForwardingSoapClient connection = (ForwardingSoapClient) connectionResolver.resolve(context).get();
Map<String, String> customHeaders = connection.getCustomHeaders(serviceId, getOperation(context));
SoapRequest request = getRequest(context, customHeaders);
SoapClient soapClient = connection.getSoapClient(serviceId);
SoapResponse response = connection.getExtensionsClientDispatcher(() -> new ExtensionsClientArgumentResolver(registry, policyManager).resolve(context).get()).map(d -> soapClient.consume(request, d)).orElseGet(() -> soapClient.consume(request));
return justOrEmpty(response.getAsResult(streamingHelperArgumentResolver.resolve(context).get()));
} catch (MessageTransformerException | TransformerException e) {
return error(e);
} catch (Exception e) {
return error(soapExceptionEnricher.enrich(e));
} catch (Throwable t) {
return error(wrapFatal(t));
}
}
Aggregations