Custom Auth not working with XML body

Hi !

I’m trying to request a SOAP API like this :

This worked but if I try to use a custom credential, it fails :

My credential is an HTTP Custom Auth :

{
    "headers": {
        "content-cype": "text/xml",
        "SOAPAction": "http://archer-tech.com/webservices/CreateUserSessionFromInstance"
    },
    "body": "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><CreateUserSessionFromInstance xmlns=\"http://archer-tech.com/webservices/\"><userName>XXXXXXXXX</userName><instanceName>production</instanceName><password>XXXXXXXXX</password></CreateUserSessionFromInstance></soap:Body></soap:Envelope>"
}

The problem seems to be in the request body. With the first node, when I look to the request sent in my browser’s developer console, the body is a string :

Whereas with the second node, the body is an object :

Looking at your workflow, the issue is likely that custom auth credentials in n8n don’t automatically work with XML/SOAP requests when you’re sending a raw XML body.

Here are a few solutions to try:

• **Use header authentication instead** - Set your authentication headers directly in the “Headers” section of the HTTP Request node rather than using a custom credential

• **Switch to “Generic Credential Type”** - Create a generic credential that just stores your auth values, then reference them in headers like `Authorization: Bearer {{$credentials.yourCred.token}}`

• **Pre-authenticate separately** - Use a separate HTTP Request node to get your auth token first, then pass it to subsequent SOAP requests via headers

The most reliable approach for SOAP APIs is usually to handle authentication through headers rather than n8n’s custom auth system, since SOAP has specific requirements that don’t always align with standard HTTP auth patterns.