lontivero/Open.NAT

Some routers return empty space prefixed in XML response text (BUG!)

zezba9000 opened this issue · 2 comments

In the file "SoapClient.cs" this line of code "var responseXml = GetXmlDocument(responseBody);" should be changed to "var responseXml = GetXmlDocument(responseBody.Trim());".

In short you need to add ".Trim()" to the "responseBody" string as some older routers return empty text prefixing the body. This ends up causing XML exceptions for otherwise successful responses.

I've fixed this in my fork: zezba9000@e71a3f8#diff-c2e74342cdb0f32b9ebd1f0af27735e95cf33a39ade1a554ce80622ccead63aeR126

My fork has more changes I didn't want to do a pull-request with though. So posting the fix here.

Fixed: dc81011

Awesome!