Skip to content

Instantly share code, notes, and snippets.

@marianogonzalez
Created April 5, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogonzalez/0092e9e23fa9ca23af19d776fc7ba95a to your computer and use it in GitHub Desktop.
Save marianogonzalez/0092e9e23fa9ca23af19d776fc7ba95a to your computer and use it in GitHub Desktop.
@OnException(SalesforceSessionExpiredExceptionSalesforceSocketConnectionExceptionEnricher.class)
@OutputResolver(output = ApexSoapMetadataCategoryResolver.class)
public XMLStreamReader invokeApexSoapMethod(@Connection AbstractConfig connection,
@DisplayName("Apex Class Method Name") @MetadataKeyId(ApexSoapMetadataCategoryResolver.class) String soapMethodName,
@Content @TypeResolver(ApexSoapMetadataCategoryResolver.class) XMLStreamReader input)
throws SalesforceException, SoapCallException {
SalesforceConnector connector = new SalesforceConnector();
connector.setConfig(connection);
connector.initialize();
// TODO: Accessing the Message or Event is no longer permitted in SDK operations.
// Operations should clearly define which data they need through their parameters. This helps ensuring that:
// -> Strict type checking works on every component
// -> Avoid operations which only works if placed in a particular part of the flow or before/after some
// component
// -> No operation can access flowVars (they are exclusive to the user)
// For more information about SDK operations, see: https://docs.mulesoft.com/mule-sdk/v/1.1/operations
XMLStreamReader result = connector.invokeApexSoapMethod(soapMethodName, input, ((MuleEvent) null));
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment