SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My client application is authenticating with a SharePoint website using the Authentication web service in Windows Sharepoint Services 3.0. The client is not written in C# and I craft the SOAP request "manually".

The authentication fails with the PasswordNotMatch LoginErrorCode when the provided password contains special characters. For instance, this password xS-5[V!VQEo!-4 generated by SharePoint fails the authentication.

What kind of encoding/escaping/processing do I need to do on the password when I build the SOAP request for authentication? Here's an example request with the password mentioned above:

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap:Envelope xmlns:xsi=\"\" xmlns:xsd=\"\" xmlns:soap=\"\">
<Login xmlns=\"\">


share|improve this question
OK, actually, the password I've given doesn't fail authentication. But I guess XML reserved characters would not be accepted, would they? – ptrico Feb 2 '12 at 9:13
It seems very likely that you would need to encode XML reserved characters: <>"& – Kit Menke Feb 2 '12 at 15:43
Hi Kit, yes probably but into what? Their corresponding entity? – ptrico Feb 3 '12 at 4:35

Looks like you figured it out already but I'm guessing it is the XML reserved characters:

< becomes &lt;
> becomes &gt;
& becomes &amp;
" becomes &quot;
' becomes &apos;

Really though, whatever language you're crafting the SOAP message in probably already has a HTML/XML encode function.

More information and a list of all the entities.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.