If you try to use a xmlNode instance in a orchestration ...biztalk will
complain that orhestration is not atomic.
So you make the transaction atomic....now assuming you have send
-receive combination in same scope you would get another error.
"an atomic scope may not contain, call or compensate a service or scope
that contains both the send and the corresponding receive of a
requestresponse operation on a 'uses' port or servicelink"
i don't want to write my own serilizable xmlNode class as far as
possible.
other option is i don't use xmlNode class.But here is why i was using
it...
1)i have complex xml structure so i want to be able to store the
intermediate result(Node).Just makes logic little simple.
2)i am doing something like this..
xmlNode childNode=ParentNode.SelectSingleNode("path");
now if don't store it in intermediate node 'childNode' and keep doing
this
ParentNode.SelectSingleNode("path") everytime i need to get to the
childNode it might be a performance hit.
.....Also by putting everthing in atomc shape what exactly is
happening?
will biztalk not try to rehydrate orcehstration till the end of the
atomic scope.
ANd if that is true why doesn't it let me use send-receive shape in
same scope.....It's not going to redydrate anyways?
any ideas ...how to handle this?
THanks
siddharth
--
McGeeky
http://mcgeeky.blogspot.com
<siddhar...@hotmail.com> wrote in message
news:1111312203.1...@z14g2000cwz.googlegroups.com...
I don't know why BizTalk has the restriction on send/receive for atomic
scopes.
Why can't you put the atomic scope around the node manipulation only? What
are you trying to do with the node exactly?
--
McGeeky
http://mcgeeky.blogspot.com
<siddhar...@hotmail.com> wrote in message
news:1111312203.1...@z14g2000cwz.googlegroups.com...
But what to do though. Can you find a way of encapsulating this logic into
a single, static method on a helper class? If so you can simply reference
and call this from your orchestration - bts will not try to dehydrate
mid-method call!
I know little about biztalk so i could be wrong but..
To me send and receive are part of same atomic transaction.
i don't undestand why it is implemented that way.
it should be able to send the message using send port and continue with
receive and if there is a error (rollback)...then it should roll back
(assuming you are using biztalk adapter otherwise we have to roll back
ourself).
It's like saying you can not put two sql statement one after the other
in sql transaction.
I want to execute first sql satement and get some results and use them
in second sql statement..but they have to be part of same transaction.
I undestand that the transactions in biztalk are little different but
some sometimes things like this make you do a lot of extra work for a
simple thing..
i will give you another example .
I am writing following code in a expression box.
strPaymentPlan =
((System.Xml.XmlNode)(TmpDoc.SelectSingleNode("DlqResearchs/DlqResearch/DelinquencyResearchInfo/TaxBills"))).ChildNodes[0].Attributes["PaymentStatus"].Value;
biztalk won't compile it.
only way to compile it is ..
Temp_System_Xml_XmlNode =
(System.Xml.XmlNode)(TmpDoc.SelectSingleNode("DlqResearchs/DlqResearch/DelinquencyResearchInfo/TaxBills"));
strPaymentPlan = Temp_System_Xml_XmlNode
.ChildNodes[0].Attributes["PaymentStatus"].Value
If you try to do it in one step it does not compile even though you are
explicitly casting it to System.Xml.XmlNode.
you have to take it in a temp variable of type system.xml.xmlNode and
then it will compile.
problem is i can not declare a XMlNode variable for the the reason i
mentioned in my previuos post...so now i have to write a external
assembly with satatic class for this simple task?
Thanks
siddharth
Dehydrating an orchestration involves persisting (serializing) all objects
within it to memory. Dehydration cannot occur while the orchestration is in
an atomic scope. Hence, if you wish to use objects that can't be persisted
then they must exist within an atomic scope (where BizTalk can't attempt to
persist them anyway).
The reason you can't have a send and receive of a request-response operation
within the same transaction is as this would break the logic. If you send a
message, the receiving end shouldn't commit (and therefore process) it until
you complete the transaction. Therefore, how can you get a response back
from a message that hasn't been committed? I hope you follow my explanation
there.
Note that although System.Xml.Document is not a serializable class, it is an
exception and can be used anywhere. If you specifically wanted to extract a
single node and store it to perform DOM operations on later, you could
create a new XmlDocument from the node and store this instead. Just an
idea; I haven't tried it and there may be more elegant solutions.
I hope this helps,
Regards,
- Bill Ticehurst [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights
<siddhar...@hotmail.com> wrote in message
news:1111312203.1...@z14g2000cwz.googlegroups.com...
This "limitation" and the provision of the compensation mechanism recognises
that you cannot use a "transaction" when dealing with external systems or
long running processes. Instead you have long running "transactions" (sagas)
which define compensations for each unit of work so that if they complete,
they can later be undone if a subsequent action fails.
- Regarding your xmlnode question, the problem is that you can't string
these objects together using the dot notation. This is because you're
programming in xlang, not in C#, although I realise they look similar. Check
this article for a description of the differences.
http://geekswithblogs.net/cyoung/articles/3820.aspx
Essentially, remember that orchestrations are first precompiled into C#
code, and THEN compiled. The intermediate step causes all sorts of
behaviours.
Good luck!
"siddhar...@hotmail.com" wrote:
> ..ChildNodes[0].Attributes["PaymentStatus"].Value
======================================================
hey.
I saw your post one this website regarding non-serializable objects,
atomic
scopes, and send-receive ports
http://www.tech-archive.net/Archive/BizTalk/microsoft.public.biztalk.general
/2005-03/0604.html
I've had a similir dilemma, and this is how I got around it *WITHOUT*
using
a freakin' .NET helper class.
I know that you can't use web service send-receive ports in an atomic
scope,
and you need atomic-scope to use non-serializable objects...it's
*ALMOST* a
classic case of catch 22 you would want to strangle the lead biztalk
developer...
anyway...as for the solution... ;-)
you need to define the orchestration with LONG-RUNNING transaction. by
default it's "no transaction." you can't use "no transaction" because
it
contain an atomic scope...
define your message types for the send and receive blah blah blah...
then define an atomic scope where you would use the non-serializable
objects
and populate your send request message inside the atomic scope (yes!
you
can!) ..........don't put the send receive ports there......well, you
can't
anyway...
at this point you can probably figure it out...the message defined in
the
global level so it's visible within the atomic scope...
I wanted to post this on the web forum but I can't figure to do
so...please
post this there...thanks.
Dexter
==========================================================
the sentence: you can't use "no transaction" because it
contain an atomic scope...
should have read:
the sentence: you can't use "no transaction" because it *CANNOT*
contain an atomic scope...
thanks.
Dexter Legaspi
biztalkieci wrote:
> Hi, I have the same problem that you... I explain... I need to use
the
> XMLNode Class to crossing the DOM XML and I need to call a Web
> service from my orquestration too. I probe the last solution that you
> tell and it does not work to me The error is that for an atomic
scope
> you can´t call web services . Do you probe it? Does it work?
> Thanks
you need to define your Orchestration as Long Running (THIS IS
IMPORTANT: Make your Orchestration Long-Running). define an atomic
scope where you would manipulate your DOM and construct your message
for calling web service. you should have the call web service OUTSIDE
THE ATOMIC SCOPE...this is why you're getting the error; the
Orchestration designer will not let you call a web service inside an
atomic scope.
this WORKS. I know because it's what I'm using.
[DistinguishedFieldAttribute]
public String OrderID;
you need to make use of Microsoft.XLANGs.BaseTypes namespace available in
the SDK.
I've attached a sample file which I grabbed from the book "Biztalk
Unleashed".
Cheers
Saravana Kumar
http://saravanakumarmv.blogspot.com
"biztalkieci" <lmal...@netscape-dot-net.no-spam.invalid> wrote in message
news:r-KdnZplsuB...@giganews.com...
> Thanks for your help .....it works!!!!.
> Another question...... How can I defined a class in .Net that could
> be serialized, (and Biztalk recognized it like Serializable) and I
> can use it in a Large-executation orchestration? (I don´t want to use
> an atomic scope for it). I tryed to use the serialized flag in the
> definition of the class and it doesn´t works.
> Thanks a lot
>