Hi,
Recenlty we wrote a plugin that was calling a WCF Rest Service. The plugin was registered on Pre Create of an entity. Here if we were creating the entity record through web interface, the plugin was running fine.
However if we had that plugin being triggered by another plugin (the other plugin was creating the entity record triggering this particular plugin) we were getting “405 – method not allowed” error.
As it turned out the WCF service was getting confused regarding the operation context when being called by another plugin.
Specifying the OperationContextScope fixed the issue.
Original Code
</pre> using ( var webChannelFactory = new WebChannelFactory<IAutoNumber>( new Uri(dictionaryConfigSettings[Constants.AutoNumberServiceUrl]))) { IAutoNumber referralOffer = webChannelFactory.CreateChannel(); // get the next number from sequence autoNumber = Constants.PrefixReferralOfferNumber + AddPadding( referralOffer.GetNextNumber(Constants.EntityNameReferralOffer), Constants.PrefixReferralOfferNumberLength); } <pre>
The modified code
</pre> using ( var webChannelFactory = new WebChannelFactory<IAutoNumber>( new Uri(dictionaryConfigSettings[Constants.AutoNumberServiceUrl]))) { IAutoNumber referralOffer = webChannelFactory.CreateChannel(); using (new OperationContextScope((IContextChannel)referralOffer)) { // get the next number from sequence autoNumber = Constants.PrefixReferralOfferNumber + AddPadding( referralOffer.GetNextNumber(Constants.EntityNameReferralOffer), Constants.PrefixReferralOfferNumberLength); } } <pre>
The helpful post
http://www.rgoarchitects.com/nblog/CommentView,guid,26d9b30e-c441-4776-9778-4dfdab58bd3d.aspx
Hope it helps.
Chcialbym rozpoczac swoja dzialalnosc. Jednak koszty z utrzymaniem jej sa dla mnie dosc znaczace. Ostatnio pomyslalem o skorzystaniu z biura wirtualnego. Znalazlem oferte http://officepoland.eu/warszawa.php … Korzystal ktos z Was uslug biura wirtualnego ? jak to wyglada w praktce? z gory dziekuje za pomoc…
LikeLike
After draining, clean the tub and the insert using a mild cleaning agent
as well as warm water. Select the toys that you want to add to the cat tree then attach them where you want them to hang.
Scratching is a natural behaviour for cats, although
you’ve probably figured this out by now given the state of your furniture and curtains.
LikeLike
I feel that is one of the so much significant information for me.
And i’m glad reading your article. However wanna statement
on few common things, The website taste is wonderful, the articles is
really excellent : D. Excellent activity, cheers
LikeLike
Howdy I am so glad I found your blog, I really found you by mistake, while I was researching on Yahoo for something else,
Nonetheless I am here now and would just like to say thank you for
a fantastic post and a all round exciting blog (I also love the theme/design), I don’t have time to read it all at the minute but I have bookmarked it and also added your RSS feeds,
so when I have time I will be back to read a great deal more, Please do keep up the great b.
LikeLike
This text is worth everyone’s attention. How can I find out more?
LikeLike
I’m gone to tell my little brother, that he should also pay a
visit this webpage on regular basis to take updated from latest
reports.
LikeLike
What a material of un-ambiguity and preserveness
of valuable knowledge on the topic of unpredicted feelings.
LikeLike
Nice blog here! Also your web site loads up fast! What host are you using?
Can I get your affiliate link to your host?
I wish my web site loaded up as quickly as yours lol
LikeLike
Wow, amazing weblog structure! How long have you been running a blog for?
you made running a blog glance easy. The overall look of your web site is
excellent, let alone the content!
LikeLike
I’m no longer certain the place you are getting your info, but good topic.
I needs to spend a while learning more or understanding more.
Thank you for fantastic information I was searching for this information for my mission.
LikeLike
I am regular visitor, how are you everybody? This paragraph
posted at this web site is in fact good.
LikeLike
Hello! This is my first visit to your blog! We are a group of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us useful information to work on. You have done
a marvellous job!
LikeLike
It’s really a nice and useful piece of information. I am glad that you simply shared this useful information with us.
Please stay us informed like this. Thank you for sharing.
LikeLike
Wonderful, what a webpage it is! This blog presents valuable data to us, keep it up.
LikeLike
Pretty! This was an incredibly wonderful post. Thank
you for providing these details.
LikeLike
Excellent blog you have here.. It’s hard to find good quality writing like yours nowadays.
I really appreciate people like you! Take care!!
LikeLike
Hi would you mind letting me know which webhost you’re using?
I’ve loaded your blog in 3 completely different web browsers and I must say this blog
loads a lot quicker then most. Can you recommend a good internet hosting provider at a fair price?
Thanks a lot, I appreciate it!
LikeLike
Thanks , I’ve recently been searching for info about this subject for ages
and yours is the greatest I’ve found out so far. But, what
in regards to the bottom line? Are you positive in regards to the supply?
LikeLike