Fix basic auth for soap

This is a modified version of the suggestion by neowizdom on the bug.

Fixes #17455