issue using BTS.MessageID after message assignment

Home Page Forums BizTalk 2004 – BizTalk 2010 issue using BTS.MessageID after message assignment

Viewing 1 reply thread
  • Author
    Posts
    • #15693

      i am facing a strange issue while using BTS.MessageID. Following is the scenario:

      I need to construct a web message using XMLDocument. I do it using construct shape and adding an assignment shape containing following statement:

      ChangeRFPProposalStatusActionRQ_Msg.StatusChange = NotificationDataXML;

      where NotificationDataXML is a variable of type XML Document.

      The next task is to retrieve the message id of this message and set it to another message. It do this using the following assignment statement:

      WebServiceTransactionLog_msg.BizTalkMessageId = ChangeRFPProposalStatusActionRQ_Msg(BTS.MessageID);

       Now when i try to run the orchestration it gives the following error:

       

      Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'NI.MeetingBroker.MBBTS.OutBound.Orchestrations.StarCiteNotifications(18772b73-02d0-9a7b-9275-842f8956fea3)'.
      The service instance will remain suspended until administratively resumed or terminated.
      If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
      InstanceId: 264e80b8-9b08-45e5-92e8-8728c288f903
      Shape name: Construct_WebServiceTransactionLog_msg0
      ShapeId: ca9f52f2-c54d-464a-9d9a-fa2714206aa4
      Exception thrown from: segment 1, progress 40
      Inner exception: There is no value associated with the property 'BTS.MessageID' in the message.
             
      Exception type: MissingPropertyException
      Source: Microsoft.XLANGs.BizTalk.Engine
      Target Site: System.Object GetPropertyValueThrows(System.Type)
      The following is a stack trace that identifies the location where the exception occured

         at Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage.GetPropertyValueThrows(Type propType)
         at NI.MeetingBroker.MBBTS.OutBound.Orchestrations.StarCiteNotifications.segment1(StopConditions stopOn)
         at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

             

      For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

      strangely enough when i put break point before calling Construct_WebServiceTransactionLog_msg0 (this does assignment using BTS.MessageID), orchestration works fine. the orchestration also works fine when i put a send port to write the web mesage to a file for testing before creating the WebServiceTransactionLog.

      Please help.

    • #15709

      So you want the message ID of the newly constructed message? 

       

      One reason you see what you are seeing is the message doesn’t get constructed until a persistence point is reached.  At that point, the new message will get persisted to the database and get assigned all the context properties.  I’m guessing the reason you see it when you run the debugger, is that forces a persistence point.  Likewise when you send out the message; another persistence point.

       

      Try this as a test…. Right after the contract put in an Atomic Scope.  This will force a persistence point.  See if that solves the problem.

       

      If that fixes it, you can then look at a better way to force a persistence to get your message id.

       

      Hope this helps.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.