This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Microsoft XML > March 2007 > BizTalk xpath
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Nick K. 2007-03-23, 7:18 pm |
| In my BizTalk Orchestration, I have an Expression shape after a response to
a web service call is received. What I am seeing is that sometimes I get an
exception and sometimes I don't. I haven't been able to determine why I get
the exception.
Here are the expressions where the exceptions happen:
bMillennium =
System.Convert.ToBoolean(xpath(MillenniumXML,"string(//@Success)"));
sMillenniumText =
System.Convert.ToString(xpath(MillenniumXML,"string(//@Exception)"));
Here is the exception I get:
Event Type: Error
Event Source: XLANG/s
Event Category: None
Event ID: 10034
Date: 3/23/2007
Time: 8:01:11 AM
User: N/A
Computer: XXXX
Description:
Uncaught exception (see the 'inner exception' below) has suspended an
instance of service
'CreateTransportOrderMessages.CreateTransportOrderOrchestration(fae54d8e-d3fd-2b17-1b54-d57506c7f855)'.
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: 94ebdbca-9683-4f22-9c23-c32b5b3c5816
Shape name: SetBoolAndText
ShapeId: ce4d7740-8a4e-4a25-88da-ed5526c93a2e
Exception thrown from: segment 1, progress 48
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
CreateTransportOrderMessages.CreateTransportOrderOrchestration.segment1(StopConditions
stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
StopConditions stopCond, Exception& exp)
Is there any change I can make to the xpath query so the exceptions don't
happen?
This exception happens inside an exception handler, why dosn't the exception
handler fire?
| |
| Yossi Dahan 2007-03-23, 7:18 pm |
| Hi Nick
To begin with I think it's worth clarifying which one of the statements
cause the exception.
I suspect that in some cases the xpath returns null and not a value, and in
any case - converting the string from the xpath directly to a boolean is
risky as it may not include a valid boolean value (for instance if it does
not exist, or is empty)
I think it'll be best to first identify you problem exactly, to that extent
I would break these into multiple, separate actions and trace their output.
do the xpath first and the conversion later so you'd see what you're trying
to convert.
Yossi Dahan
http://www.sabratech.co.uk/blogs/yossidahan
"Nick K." wrote:
> In my BizTalk Orchestration, I have an Expression shape after a response to
> a web service call is received. What I am seeing is that sometimes I get an
> exception and sometimes I don't. I haven't been able to determine why I get
> the exception.
>
> Here are the expressions where the exceptions happen:
>
> bMillennium =
> System.Convert.ToBoolean(xpath(MillenniumXML,"string(//@Success)"));
>
> sMillenniumText =
> System.Convert.ToString(xpath(MillenniumXML,"string(//@Exception)"));
>
> Here is the exception I get:
>
> Event Type: Error
> Event Source: XLANG/s
> Event Category: None
> Event ID: 10034
> Date: 3/23/2007
> Time: 8:01:11 AM
> User: N/A
> Computer: XXXX
> Description:
> Uncaught exception (see the 'inner exception' below) has suspended an
> instance of service
> 'CreateTransportOrderMessages.CreateTransportOrderOrchestration(fae54d8e-d3fd-2b17-1b54-d57506c7f855)'.
> 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: 94ebdbca-9683-4f22-9c23-c32b5b3c5816
> Shape name: SetBoolAndText
> ShapeId: ce4d7740-8a4e-4a25-88da-ed5526c93a2e
> Exception thrown from: segment 1, progress 48
> 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
> CreateTransportOrderMessages.CreateTransportOrderOrchestration.segment1(StopConditions
> stopOn)
> at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
> StopConditions stopCond, Exception& exp)
>
> Is there any change I can make to the xpath query so the exceptions don't
> happen?
>
> This exception happens inside an exception handler, why dosn't the exception
> handler fire?
>
>
>
>
>
>
>
| |
| Nick K. 2007-03-23, 7:18 pm |
| The exception does not tell me which expression failed.
In running a query on suspended messages this is the message that is
suspended:
<string><ns0:SubmitAck Success="true" Exception=""
xmlns:ns0="http://Millennium.SubmitAcknowledgment"></ns0:SubmitAck></string>
Is there any reason why these xpaths should fail with this message? Why
didn't the exception handler fire?
"Yossi Dahan" <yossi.dahanREMOVE@THISsabratech.co.uk> wrote in message
news:0A9027A1-D98F-468B-9B77-BE5E6374F404@microsoft.com...[color=darkred]
> Hi Nick
>
> To begin with I think it's worth clarifying which one of the statements
> cause the exception.
> I suspect that in some cases the xpath returns null and not a value, and
> in
> any case - converting the string from the xpath directly to a boolean is
> risky as it may not include a valid boolean value (for instance if it does
> not exist, or is empty)
>
> I think it'll be best to first identify you problem exactly, to that
> extent
> I would break these into multiple, separate actions and trace their
> output.
> do the xpath first and the conversion later so you'd see what you're
> trying
> to convert.
>
>
> Yossi Dahan
> http://www.sabratech.co.uk/blogs/yossidahan
>
>
> "Nick K." wrote:
>
| |
| Jan Eliasen 2007-03-23, 7:18 pm |
| On Fri, 23 Mar 2007 08:35:31 -0600, "Nick K." <nkarger@msn.com> wrote:
>The exception does not tell me which expression failed.
Try splitting your expression into two different (or more) expression
shapes.
Also, try splitting eah statement into several lines, so you set a
string to get the value from the xpath expression and later convert it
into boolean. Try outputting the content along the way to the
eventlog, in order to debug.
--
eliasen, representing himself and not the company he works for.
Private blog: http://blog.eliasen.dk
Private email: jan@eliasen.dk
| |
| Proveniebam 2007-03-23, 7:18 pm |
| Doesn't sort out the problem but maybe approach it from a different
angle. Promote the field and access it directly instead of Xpath.
Makes for more maintainable code.
(If it's a response from a webservice then you open up the webrefernce
and down to the Reference.xsd and do the promotion on that file.)
| |
| Nick K. 2007-03-23, 7:18 pm |
| I split each statement into several lines and put eventlog logging
throughout.
As it turns out the xpath statements I was looking at were not the problem.
It appears that this is causing the problem:
xmlDocument = new System.Xml.XmlDocument();
xmlDocument = InputMessage;
What happens is that I call a web service twice. I pass the exact same xml
data each time I call the web service. The first time I call it, I get a
good response back. The second time I call it, it hangs and I look at the
event log.
I know that InputMessage is in good shape at the beginning of the
orchestration the second time I call it because the eventlog tells me so.
but later on in the orchestration the assignment shown above (xmlDocument =
InputMessage;) is where it fails.
Why would the first time work and the second time fail?
"Jan Eliasen" <eliasen@nospam.nospam> wrote in message
news:53t7035bum08schb8c87s08eddp9357nne@4ax.com...
> On Fri, 23 Mar 2007 08:35:31 -0600, "Nick K." <nkarger@msn.com> wrote:
>
> Try splitting your expression into two different (or more) expression
> shapes.
>
> Also, try splitting eah statement into several lines, so you set a
> string to get the value from the xpath expression and later convert it
> into boolean. Try outputting the content along the way to the
> eventlog, in order to debug.
>
> --
> eliasen, representing himself and not the company he works for.
>
> Private blog: http://blog.eliasen.dk
>
> Private email: jan@eliasen.dk
| |
| Nick K. 2007-03-23, 7:18 pm |
| I have now proven that InputMessage goes null somewhere in the orchestration
the second time it is called. What I did to prove this is to create a
variable xmlInputMessage and at the top of the orchestration assign
xmlInputMessage to InputMessage. Later on in the orchestration I assign
InputMessage to xmlInputMessage.
What I am doing between the start of the orchestration and the end is:
Call a .Net assembly that does schema validation.
Map from one schema to another.
Call a web service and get a response back.
This all worked the first time it was called and when called a second time
InputMessage was null.
I have no clue how to track this down or what is going wrong to set
InputMessage to null.
"Nick K." <nkarger@msn.com> wrote in message
news:O6ppGnXbHHA.4872@TK2MSFTNGP03.phx.gbl...
>I split each statement into several lines and put eventlog logging
>throughout.
>
> As it turns out the xpath statements I was looking at were not the
> problem. It appears that this is causing the problem:
> xmlDocument = new System.Xml.XmlDocument();
>
> xmlDocument = InputMessage;
>
> What happens is that I call a web service twice. I pass the exact same xml
> data each time I call the web service. The first time I call it, I get a
> good response back. The second time I call it, it hangs and I look at the
> event log.
>
> I know that InputMessage is in good shape at the beginning of the
> orchestration the second time I call it because the eventlog tells me so.
> but later on in the orchestration the assignment shown above (xmlDocument
> = InputMessage;) is where it fails.
>
> Why would the first time work and the second time fail?
>
> "Jan Eliasen" <eliasen@nospam.nospam> wrote in message
> news:53t7035bum08schb8c87s08eddp9357nne@4ax.com...
>
>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|