You ever find that newsgroup post on a technical subject that absolutely saves the day? One of my projects has an orchestration that calls a web service. I call this service in a “loop” because if a call fails (for “business” or “technical” reasons), it may need to retried. So, until I set a “ProcessComplete” flag, the loop continues.
That said, if I DO get an error, I send the message out for review. If I don’t get a response within an hour, I auto-retry the service again. This is done with a transactional scope (long-running) and a timeout. So naturally I have to use correlation to send a message out of my orchestration, and potentially receive a message back. However, after setting this up the first time, I got a
Correlation set may be initialized only once
error. This makes sense since I had a global correlation set, and was potentially initializing it over and over in a loop. After staring at my computer for 4 minutes thinking, I did a quick search online and came across a newsgroup post where my new best friend, Tomas Restrepo, reminded me that a *scope* can have its own local correlations sets.
Sure enough, after moving the correlation set to the local scope, everything compiled fine.
Technorati Tags: BizTalk
Hey, I’m glad I was able to help π
What’s funny is that I found out about this while trying to do something pretty similar to your own stuff (i.e. manually handling retries in a webservice call) π
Well if Thomas is your new best friend, you’re *my* new best friend, since your blog came up when I googled π
Thanks for writing it out, for me to find. A scope – of course…
Thanks for the tip!
Fantastic!. Thanks for blogging the issue. Absolute life saver π
Beautiful!!!!!
Saved my day!!!
Thank you so much, this post saved me a lot of pain!
Add me to the list of thank yous And thanks also for redirecting me over here from the MSDN Forum.
Saved my day ! Thx !
Have you tried correlation with 2 different message. I am using your latest book SOA patterns but couldn’t find any note on that.
Here is my problem…I am inserting a XML message in a db table via WCF sql send adapter (store procedure pInsertMsg). I am waiting for external process to update that message. I use WCF SQL recieve adapter (store procedure pGetMsg) to get that message back to my orchestration. I cannot correlate this message because of their different MessageType and root. Moreover the get has TypedPolling so it create a different xsd.
Can you help?
Thushar, the correlation shouldn’t be dependent on a different message type/root as long as you promote the fields in all the source schemas to the same property in the property schema. Have you already done that?
I can not belive how simple the solution to my problem was. I am quite new to BizTalk-development and I have been struggeling with this issue for for more than a day. Thank you for posting this!
Great idea . . . Thank you very much !
Thanx, just what I needed
Thanks
Ha, such a simple gotcha, but thanks for writing it up! Saved me a bit of time.
Thanks a lot! Saved my day – incredible that I haven’t needed to do this earlier although I’ve been mostly working with BizTalk for the last 12 years…