Saturday, October 31, 2009

Received a "System.NotImplementedException" in custom pipeline component

When testing our custom pipeline component, we could receive a System.NotImplementedException.

If we are using the Http adapter with our pipeline and we use the Data property from the Message.BodyPart, the error is because the Http adapter implements de Setter but not the Getter for this property.

In this case, we have to use the GetOriginalDataStream method, instead of Getter of Data property:

Stream myBodyStream = Message.BodyPart.Data (Incorrect)
Stream myBodyStream = Message.BodyPart.GetOriginalDataStream() (Correct)

No comments: