Use SOAP API WSS Security Header on Bubble

If you’re currently trying to integrate a SOAP API into your Bubble application, the API may ask you to add a username and password in the header of your SOAP message.

The documentation for the API I was trying to integrate asked me to see the demo on SOAP UI, but to get a real example to integrate into Bubble I usually use Postman directly.

I tried this:

<soapenv:Header>
    <wsse:Security soapenv:mustUnderstand=“1”>
        <wsse:UsernameToken>
            <wsse:Username>myusernamehere</wsse:Username>
            <wsse:Password Type=“PasswordText”>passwordhere</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>
</soapenv:Header>

It didn’t work. However I didn’t understand, I put WSSE Security Header tags, I then tried to encrypt my password in SHA256 as I found on several forums. Anyway.

I kept getting this error:

Status code 500
<soap:Envelope xmlns:soap=“http://schemas.xmlsoap.org/soap/envelope/”>soap:Bodysoap:Faultns1:InvalidSecurityAn error was discovered processing the <wsse:Security> header</soap:Fault></soap:Body></soap:Envelope>

The solution was actually much simpler and what’s above is just for referencing in case someone has the same error :

You need to add the precise links for the schematics, try it with this:

<soapenv:Header>
    <wsse:Security soapenv:mustUnderstand=“1” xmlns:wsse=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd”>
        <wsse:UsernameToken>
            <wsse:Username>myusernamehere</wsse:Username>
            <wsse:Password Type=“http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText”>passwordhere</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>
</soapenv:Header>

SOAPUI handles it automatically. That’s why it wasn’t working on Postman.
Hope it will help someone.