sveawebpay / dotnet-integration

SDK for Sveas standalone payment methods
Other
5 stars 14 forks source link

HostedXmlBuilder.cs contains a bug. #12

Closed irkush closed 10 years ago

irkush commented 10 years ago

When calling the method GetXml the class member _xmlw is created inside of an using block. This causes the XmlWriter to be disposed when the block finishes and the locally stored variable is thus useless.

Change so that there is no local variable in the class for the XmlWriter and use the functionality in C# correctly.

using (_xmlw = XmlWriter.Create(xmlOutput, xmlSettings))
{
   // Omited for clarity.
}

_xmlw.Something(); <--- The variable is disposed here and most likely throws an Exception if being called upon.
Sinsabre commented 10 years ago

Solved in b09f10fbf80d8b0f4db01071e08ea83c72e3c4e0