Loading

How to Set SOAP Headers When Using Invoke Apex SOAP Method in Salesforce Flow or MuleSoft Connector

Data pubblicazione: May 1, 2026
Prerequisito/i
What Are SOAP Headers? SOAP headers are optional elements in a SOAP request envelope that carry metadata such as authentication credentials, session tokens, or routing information. When calling an Apex web service that requires SOAP headers, you must configure the header parameters in the tool or connector you are using to invoke the service. This article covers the configuration of SOAP headers when using the Invoke Apex SOAP Method action in one of the following contexts: * Salesforce Flow Builder (using the Apex Action element) * MuleSoft Salesforce Connector (using the Invoke Apex SOAP Method operation)
Operazione

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.

Fasi

Steps to Set SOAP Headers [CONTENT REQUIRED FROM SME]

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. 

Numero articolo Knowledge

001115316

 
Caricamento
Salesforce Help | Article