2011 m. spalio 26 d., trečiadienis

Exception: (503) Bad Gateway before transformation

There was one project, with large numbers of messages going through the biztalk server (about 30 k messages per day). During testing stage everything lookded fine, but after production deployment there was some kind of  exceptions occouring on random files:
Exception: (503) Bad Gateway
What bothered mostly - after resuming stopped instances all the instances completed their job successfully.
Usually this exception occoured within transform shape, which made me very suspicious - why does transform shape need a gateway? After looking inside the files transfered, I've found DTD declaration within each file, which made me suspicious.
I've wrote small helper method, which removes DOCTYPE declaration from the Xml file:
public static XmlDocument RemoveDTDReference(XmlDocument xmlDocument)
                XmlDocumentType XDType = xmlDocument.DocumentType;
            catch { }
            return xmlDocument;
By using simple costruct shape expression, I've created new message before the transform:
ProductNoDTD = HelperClass.MessageReceiver.RemoveDTDReference(Product);
Thats it!

Komentarų nėra:

Rašyti komentarą