Wednesday, 10 June 2015

Firefox and XML Parsing Error: no element found

I kept getting this error from a newly deployed .Net web service when trying to access the SVC file.

The web services works, which is unusual but it was just the svc file and therefore the wsdl that wasn't. However, I could use svcutil to create the client classes so that was also weird.

tl;dr? I use a client certificate for authentication. If this is set to negotiatessl instead of requiressl in the web configuration, Firefox WON'T ask you to choose a client certificate. Instead, you get a 403 (forbidden) error returned with no body and Firefox in it's wisdom decides that because it asked for xml, the response must also be xml but blank is obviously invalid and you get the error.

When I ran Fiddler to check the request/response, it all worked correctly (obviously Fiddler found the correct CC and used it!) but when you use Chrome, it was clever enough to work it out and ask you to choose a client certificate. Whether this was because of a previous call which cached the client certificate need or by some other means, I don't know.

So you can't test this on FireFox it seems (without using Fiddler) but would need to use Chrome instead. Naughty Firefox.
Post a Comment