Setting headers while invoking the Apex Soap method is an important aspect of web service integration in Salesforce. In this article, we will discuss how to set the headers while using the Invoke Apex Soap Method of the Salesforce Connector.
The specific steps for setting SOAP headers will vary depending on whether you are using Apex or the MuleSoft Salesforce Connector. Please provide the step-by-step configuration instructions here.
For Salesforce flow using apex invocable methods- :https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm and How to set the SOAP headers while using Invoke Apex Soap Method in Salesforce Connector- https://help.salesforce.com/s/articleView?id=001115316&type=1 For MuleSoft Salesforce Connector-https://docs.mulesoft.com/salesforce-connector/latest/
<flow name="sf-contacts-cleanupFlow2">
<http:listener doc:name="Listener" config-ref="HTTP_Listener_config" path="/apex"/>
<ee:transform doc:name="Transform Message">
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/xml
ns ns0 http://soap.sforce.com/schemas/class/InvokeApexTest
---
{
ns0#sayHello: {
ns0#name: "Name",
ns0#someNumber: 1
}
}]]></ee:set-payload>
</ee:message>
<ee:variables >
<ee:set-variable variableName="DebugHeader" ><![CDATA[%dw 2.0
output application/json
---
{
"DebuggingHeader": {
"debugLevel": "Debugonly"
}
}]]></ee:set-variable>
</ee:variables>
</ee:transform>
<salesforce:invoke-apex-soap-method doc:name="Invoke apex soap method" config-ref="Salesforce_Config" methodName="sayHello" className="InvokeApexTest" apexHeaders="#[vars.DebugHeader]">
</salesforce:invoke-apex-soap-method>
<ee:transform doc:name="Transform Message" >
<ee:message >
<ee:set-payload ><![CDATA[%dw 2.0
output application/json
---
payload]]></ee:set-payload>
</ee:message>
</ee:transform>
</flow>
For information on Apex SOAP Headers, please refer to this Salesforce documentation.
001115316

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.