when message comes biztalk pipeline , ibasemessage instance stands incoming message ? , property , , how understand this?
the 2 parts you'll interested in ibasemessage
bodparty.getoriginaldatastream()
, context
objects. example
stream originaldatastream = pinmsg.bodypart.getoriginaldatastream(); string msgasstring; xdocument msgasxdoc; streamreader sr = new streamreader(originaldatastream) msgasstring = sr.readtoend(); originaldatastream.position = 0; // important reset before passing message on! msgasxdoc = xdocument.load(originaldatastream); // have in xdoc originaldatastream.position = 0; xmlreader xr = xmlreader.create(originaldatastream) originaldatastream.position = 0; string strproperty = (string)pinmsg.context.read("propertyname", "http://propertynamespace"); string anotherproperty = "testing"; pinmsg.context.write("anotherpropertyname", "http://propertynamespace", anotherproperty) pcontext.resourcetracker.add(xr); pcontext.resourcetracker.add(sr);
etc.
a couple other notes:
- avoid 'using' constructs, end disposing of underlying stream , causing errors
- add disposable objects context's resource tracker, make sure call
dispose()
on objects when underlying stream ready disposed of.
Comments
Post a Comment