Prizes & Awards
My Profile
Active Members
TodayLast 7 Days
more...
|
Forums » .NET » BizTalk »
Xpath and distinguished fields not working
Posted Date: 29 Aug 2009 Posted By: Sam Member Level: Bronze Points: 1
Responses:
0
|
Dear All,
I have spent a couple days on this problem with no resolution, I just need to retrieve the value of an element in one of my orchestrations, I have done this in other projects in the solution with xpath by doing this and this is what I am doing
CurrentDateString = System.Convert.ToString(xpath(BankRefundCutOffRQ, "string(/*[local-name()='SADAD' and namespace-uri()='']/*[local-name()='BankSvcRq' and namespace-uri()='']/*[local-name()='BankRefundCutOffRq' and namespace-uri()='']/*[local-name()='PrcDt' and namespace-uri()=''])"));
I don't understand why it works in other projects with other messages and not here, I copied the namespace and path from the schema by clicking on the element itself.
I also tried to distinguish the field and call it using (I converted to string because the element is defined as DateTime)
CurrentDateString = System.Convert.ToString(BankRefundCutOffRQ.BankSvcRq.BankRefundCutOffRq.PrcDt);
the funny thing is this call to count the same element which I am trying to retreive returns the correct value (returns 1)
recordCount = System.Convert.ToString(xpath(BankRefundCutOffRQ, "count(/*[local-name()='SADAD' and namespace-uri()='']/*[local-name()='BankSvcRq' and namespace-uri()='']/*[local-name()='BankRefundCutOffRq' and namespace-uri()='']/*[local-name()='PrcDt' and namespace-uri()=''])"));
at one point I thought maybe I had a missing assembly reference, I checked the other projects and they reference Microsoft.BizTalk.GlobalPropertySchemas
so I added that to my project with no luck..Please HELP! I can't believe so much time was wasted on this silly problem
My XML message I am using looks like this
- <SADAD>
- <SignonRq> <ClientDt>2009-08-22T12:28:53</ClientDt> - <SignonProfile> <Sender>001</Sender> <Receiver>RI</Receiver> <MsgCode>RCUTRQ</MsgCode> </SignonProfile> </SignonRq> - <BankSvcRq> - <Status> <StatusCode>0</StatusCode> <ShortDesc>Success</ShortDesc> <Severity>Info</Severity> </Status> <RqUID>71B82E65-F40B-30EC-E043-0A10113730EC</RqUID> - <BankRefundCutOffRq> <PrcDt>2009-08-21T00:00:00</PrcDt> </BankRefundCutOffRq> </BankSvcRq> </SADAD> Finally here is the error I got, I get the same exact error no mater if I use xpath or the distinguished fields Description: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MOI.MOI_BankRefundCutoffOrcn(06eed797-301b-d3ce-fa5f-311542544d0b)'. 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: 7f335f72-eccf-463f-bedb-5154f82e0722 Shape name: Construct Date ShapeId: 804d2a5d-f34f-42fa-acf5-cc60d56665a5 Exception thrown from: segment 1, progress 58 Inner exception: Object reference not set to an instance of an object. Exception type: NullReferenceException Source: Microsoft.XLANGs.Engine Target Site: System.Object XPathLoad(Microsoft.XLANGs.Core.Part, System.String, System.Type) The following is a stack trace that identifies the location where the exception occured at Microsoft.XLANGs.Core.Part.XPathLoad(Part sourcePart, String xpath, Type dstType) at MOI.MOI_BankRefundCutoffOrcn.segment1(StopConditions stopOn) at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
|
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|
| Post Reply |
|
|
|
You must Sign In to post a response.
|
|
|
|