Wednesday, March 02, 2005

Accessing Standard Context properties in Biztalk pipelines like FileName

If you wnated to access context properties in pipelines and have spent needless time figuring out the correct schema for each property here is a comprehensive list

This content is taken as is from Stephen Kaufman's WebLog

There are a number of 'built in' promoted properties that provide important information. There are different items for the receive and send pipelines.



The 14 receive pipeline items are (including the associated namespace):

1. ReceivedFileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

2. InboundTransportLocation (http://schemas.microsoft.com/BizTalk/2003/system-properties)

3. InterchangeID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

4. ReceivePortID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

5. ReceivePortName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

6. WasSolicitResponse (http://schemas.microsoft.com/BizTalk/2003/system-properties)

7. AuthenticationRequiredOnReceivePort (http://schemas.microsoft.com/BizTalk/2003/system-properties)

8. InboundTransportType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

9. LRPMsgBodyTracking (http://schemas.microsoft.com/BizTalk/2003/system-properties)

10. MessageExchangePattern (http://schemas.microsoft.com/BizTalk/2003/system-properties)

11. PortName (http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties)

12. ReceivePipelineID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

13. MessageType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

14. SchemaStrongName (http://schemas.microsoft.com/BizTalk/2003/system-properties)



While the 31 send pipeline items are

1. CopyMode (http://schemas.microsoft.com/BizTalk/2003/file-properties)

2. LTPMsgBodyTracking (http://schemas.microsoft.com/BizTalk/2003/system-properties)

3. ReceivedFileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

4. SPID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

5. ActualRetryCount (http://schemas.microsoft.com/BizTalk/2003/system-properties)

6. FileName (http://schemas.microsoft.com/BizTalk/2003/file-properties)

7. PartyName (http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties)

8. ReceivePortName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

9. WasSolicitResponse (http://schemas.microsoft.com/BizTalk/2003/system-properties)

10. AllowCacheOnWrite (http://schemas.microsoft.com/BizTalk/2003/file-properties)

11. RetryInterval (http://schemas.microsoft.com/BizTalk/2003/system-properties)

12. OutboundTransportCLSID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

13. SPName (http://schemas.microsoft.com/BizTalk/2003/system-properties)

14. InboundTransportLocation (http://schemas.microsoft.com/BizTalk/2003/system-properties)

15. InterchangeID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

16. ReceivePortID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

17. SPTransportID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

18. TransmitPipelineID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

19. AuthenticationRequiredOnReceivePort (http://schemas.microsoft.com/BizTalk/2003/system-properties)

20. InboundTransportType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

21. LRPMsgBodyTracking (http://schemas.microsoft.com/BizTalk/2003/system-properties)

22. MessageExchangePattern (http://schemas.microsoft.com/BizTalk/2003/system-properties)

23. OutboundTransportLocation (http://schemas.microsoft.com/BizTalk/2003/system-properties)

24. PortName (http://schemas.microsoft.com/BizTalk/2003/messagetracking-properties)

25. ReceivePipelineID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

26. SourcePartyID (http://schemas.microsoft.com/BizTalk/2003/system-properties)

27. MessageType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

28. OutboundTransportType (http://schemas.microsoft.com/BizTalk/2003/system-properties)

29. PartNames (http://schemas.microsoft.com/BizTalk/2003/messageagent-properties)

30. RetryCount (http://schemas.microsoft.com/BizTalk/2003/system-properties)

31. SchemaStrongName (http://schemas.microsoft.com/BizTalk/2003/system-properties)





To get access to these properties you need to get access to the context object. The following method shell shows how we can do that.



public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)

{

IBaseMessageContext context = pInMsg.Context;
.
.
.
}


Now that we have a method to gain access to the context, what if we want to get access to the internal promoted properties? We can iterate through all of the default promoted properties by using the context.ReadAt method (which produces the list of the items above). This method takes an index and returns, through 2 out parameters, the name and namespace of the properties.

We can also use the context.Read method to access the value of each of these promoted properties. The Read method returns an object type containing the value of the promoted property when passing in the name and namespace of the property.


So, to retrieve the source file name we would use this following line of code:



string srcFileName = context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString();

Biztalk Cool stuff

Some of the good Biztalk cool Stuff available out there

  • BizTalk Server 2004 "deploy with Nant" template
    Integrating BizTalk Server with Nant
  • BizTalk Server 2004 Pipeline Component Wizard 
    VS.NET addin for quickly building pipeline components
  • BizTalk AutoDeploy Utility
    VS.NET addin for quickly (re)deploying BizTalk Server solutions. 
    No need for Ant
  • BizTalk Server 2004 Performance Tool
    Tool that allows for BizTalk Server tuning.
  • BizTalk Server 2004 Transactional .NET Adapter
    adapter that allows for transactional message transmission to any .NET component.
  • BizTalk Server 2004 Tracking Playground
    Tracking demo application showing how to make use of the tracking db views and WMI.
  • BizTalk Server 2004 Management Tool
    This is good...
  • BizTalk Explorer
    Doing what VS.NET allows you to do, without VS.NET :-)
  • BizTalk Server Service Windows
    Allows for more flexible service windows.
  • BizTalk Server POP3 Adapter
    Inbound email messages in BizTalk Server
  • BizTalk Server TIBCO Adapter
    Rudimentary sample
  • BizTalk Server SQL BLOB Adapter
    Readingand writing message to binary SQL columns.
  • Tuesday, March 01, 2005

    Biztalk Accelerator for Rosettanet Releases

    Biztalk 2004 Accelerator for Rosettanet released.I have been involved with the accelerator for some time in 2003 so I feel very good personally about this. It was really a great experience working at microsoft although I later moved on from seatlle

    I think this is the last of the Biztalk 2004 accelerators from Microsoft

    The key features
    Certified RosettaNet Ready™ RNIF 2.0. Full compliance with the RosettaNet Implementation Framework (RNIF) versions 1.1 and 2.
    Rapid development. Out-of-the-box implementation of all existing Partner Interface Processes (PIPs)
    Support for CIDX. Support for the Chemical Industry Data Exchange (CIDX) Chem eStandards version 2.0.2
    Built-in management console. Built-in management tools for managing all RosettaNet-based trading partners and existing processes from a single console
    Orchestration of RosettaNet processes. BizTalk Orchestration Designer makes it easy for users to visually modify private processes and orchestrations that integrate with public RosettaNet business processes.
    Definition and documentation of schema. BizTalk Editor enables users to easily define and edit document schema for any structured document type, including all RosettaNet messages.
    Flexibility for custom RosettaNet solutions. The software development kit and comprehensive documentation help users develop tailored RosettaNet solutions.