Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Xpath to assign value to element giving Biztalk error – PLease help
- This topic has 4 replies, 1 voice, and was last updated 9 years, 1 month ago by
community-content.
-
AuthorPosts
-
-
February 16, 2010 at 3:44 PM #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
<Value>1</Value><BOLKEY>BOL</BOLKEY><BOLTRUCKID>BOLTRUCKID_0</BOLTRUCKID><KEYS>HDR</KEYS><TRAILERPO>TRAILERPO_0</TRAILERPO><SHIPDATE>SHIPDATE_0</SHIPDATE><SHIPTIME>SHIPTIME_0</SHIPTIME><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)
-
February 17, 2010 at 4:00 AM #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);
-
February 17, 2010 at 8:43 AM #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’ and namespace-uri()=”]’ has an invalid token.
Can you please help
-
February 17, 2010 at 9:06 AM #24237
There was a ] missing. I corrected that and now I am getting the same error as the original post
PLease help anyone
-
February 17, 2010 at 3:00 PM #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
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.