Xpath to assign value to element giving Biztalk error – PLease help

Home Page Forums BizTalk 2004 – BizTalk 2010 Xpath to assign value to element giving Biztalk error – PLease help

Viewing 1 reply thread
  • Author
    Posts
    • #24230

      Hi,

         I am trying to assign a value to an element in Message assignment as

      xpath(NewBlx856FFMessageCopy.MessagePart,”(/Root/Value)”)=System.Convert.ToString(This856);

      This856 is Int32

      I keep getting the following error. I have tried different ways. PLease help.

      I have 1 as default value for the element “Element”

      Here is the sample of the instance

      <ns0:Root xmlns:ns0=”http://Blx856Outbound.Blx856FF>
        <Value>1</Value>
      <BOL>
        <BOLKEY>BOL</BOLKEY>
        <BOLTRUCKID>BOLTRUCKID_0</BOLTRUCKID>
      <HDR>
        <KEYS>HDR</KEYS>
        <TRAILERPO>TRAILERPO_0</TRAILERPO>
        <SHIPDATE>SHIPDATE_0</SHIPDATE>
        <SHIPTIME>SHIPTIME_0</SHIPTIME>
      <HDRSUB>
        <KEYU>SDL</KEYU>
        <SCAC_CODE>SCAC_CODE_0</SCAC_CODE>
        <CARRIER_ID>CARRIER_ID_0</CARRIER_ID>
        <BOL_ID>BOL_ID_0</BOL_ID>
        <PROBILL_NO>PROBILL_NO_0</PROBILL_NO>
        <SHIP_DATE>SHIP_DATE_0</SHIP_DATE>
        <SHIPTO_NAME>SHIPTO_NAME_0</SHIPTO_NAME>
        <SHIPTO_ADDRESS>SHIPTO_ADDRESS_0</SHIPTO_ADDRESS>
        <SHIPTO_CITY>SHIPTO_CITY_0</SHIPTO_CITY>
        <SHIPTO_PROVINCE>SHIPTO_PROVINCE_0</SHIPTO_PROVINCE>

      Error/

      lang/s engine event log entry: Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘Blx856Outbound.Blx856Outbound_Orchestration(34c00198-2e1e-68fb-a6df-20ced993af14)’.

      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: 0752dfe8-cb8b-4420-8724-c58019993d0b

      Shape name:

      ShapeId:

      Exception thrown from: segment -1, progress -1

      Inner exception: The XPath expression ‘(/Root/Value)’ selected a node which is not valid for property or distinguished field retrieval, or it selected no node at all. Only text-only elements or attributes may be selected.

       

      Exception type: XPathSelectionException

      Source: Microsoft.XLANGs.Engine

      Target Site: Void XPathStore(System.Object, System.String)

      The following is a stack trace that identifies the location where the exception occured

      at Microsoft.XLANGs.Core.Part.XPathStore(Object rValue, String xpath)

      at Blx856Outbound.Blx856Outbound_Orchestration.segment1(StopConditions stopOn)

      at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

       

    • #24233

      hi,

      I think your Xpath request is not valid maybe du to the namespace.

      Try the following Request :

      xpath(NewBlx856FFMessageCopy.MessagePart,”//Root/Value”))=System.Convert.ToString(This856);

      or

      xpath(NewBlx856FFMessageCopy.MessagePart,”/*[local-name()=’Root’ and namespace-uri()=’http://Blx856Outbound.Blx856FF‘/*[local-name()=’Value’ and namespace-uri()=”]”)=System.Convert.ToString(This856);

       

      • #24236

        Thank you for the solution, but 1st  one is giving the same error but 2nd one is giving the below error

        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: 1260b7ad-1b54-4b39-b9d6-89c370086e6b

        Shape name: ConstructMessage_1

        ShapeId: 4550da5e-acfe-4062-a6dd-263fe881da71

        Exception thrown from: segment 1, progress 20

        Inner exception: ‘/*[local-name()=’Root’ and namespace-uri()=’http://Blx856Outbound.Blx856FF’/*%5Blocal-name()=’Value&#8217; and namespace-uri()=”]’ has an invalid token.

         

        Can you please help

        • #24237

          There was a ] missing. I corrected that and now I am getting the same error as the original post

           

          PLease help anyone

          • #24239

            Ok,

            Sorry for the missed ].

            I have made an orchestration with your schema in an orchestration.

            To verify that the Xpath is correct, check the following properties in the node of the xsd schema : Instance Xpath.

            If it is correct, verify that the node exist. The Xpath command can modify a node-value but can’t create a node.

            In your construct message, do you use a Transform with a map or do you try to set the message directly? (If you use a transform map,be sure that you create the node).

            If necessary, post more details on your orchestration

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