Hi Guys
I have been trying to build my first ever Service Interceptor but I have hit a few issues and wondered if any of you guys could help! In an attempt to get this to work I have just tried to write a line in the Tessitura Log as per Ryan's "Hello World" interceptor but I still can't even get this to write in to the log! Any help would be great.
I have put together a very simple interceptor that looks like below and built in visual studio and copied over DLL to the plugins folder. I have enabled both plugs and reload plugin config.
using Tessitura.Services.Common.Interceptor.Client;using Tessitura.Services.Common.Logger;namespace Tessitura.WMC.Interceptor{public class HelloInterceptor{ public static PluginData Operation(PluginData input) { input.Logger.Trace("Hello World!!"); return input; }
}}
I have registered this as a plugin like so in the xml doc.
<PluginConfigs> <PluginConfig> <UriMatch>CRM/*</UriMatch> <Verb>GET</Verb> <FullPluginName>Tessitura.WMC.Interceptor.HelloInterceptor</FullPluginName> <PluginPlacement>POST</PluginPlacement> </PluginConfig></PluginConfigs>
I have looked in the TessituraService Logs and I can't see anything that might cause a problem! I did have a typo in my XML which I did fix. So a bit stuck on how to get the "Hello World" to appear in the logs. I have tried load of different UriMatches including <UriMatch>CRM/Constituents/*/Snapshot</UriMatch> but still nothing appears in the logs after I search for and open a constituent record.
Do you guys have anything that you think i should check? Any help would be much appreciated!
Thanks
Nick
Thanks guys for the suggestions, very useful, I did have both the EnablePlugins and ReloadPluginConfig set to True so at least it wasn’t me making a dumb mistake and not actually turning the plugins on.
Genius idea about the Logging! I have just enabled the Trace logging on the service rather than just the client and seemed to have narrowed it down to the URI Matching of the plugin xml. Not sure why it’s not matching as I thought * was a wild card but at least it gives me a starting point!
2014-09-03 09:16:09.3664|Trace|ninsell:Admin:WMCD7NI00344|Executing GET request at /TessituraService/CRM/Constituents/Search?type=fluent&q=insell
2014-09-03 09:16:09.3664|Info|STARTING RELOAD OF PLUGINS
2014-09-03 09:16:09.4404|Info|ENDING RELOAD OF PLUGINS
2014-09-03 09:16:09.4404|Debug|Using item with key 'TS:CK:AllDefaultEntities' from the cache.
2014-09-03 09:16:10.5355|Debug|Verb and Placement matched but RegEx for URI match '^CRM/[^/]*(/)?$' didn't match the actual URI 'CRM/Constituents/Search/?type=fluent&q=insell'.
2014-09-03 09:16:10.5355|Trace|Total time for '/TessituraService/CRM/Constituents/Search?type=fluent&q=insell' : 1169 ms.
From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of David Frederick Sent: 02 September 2014 19:35 To: Nick Insell Subject: Re: [Tessitura Technical Forum] Service Interceptor Help!
Hi Nick,
Forgive me if I'm suggesting something you already did, but I didn't see mention of this in your message... Did you set the logger Trace level in the NLog.config file of the Tessitura services? Specifically, this line which should be near the end of the file:
<logger name="*" minlevel="Trace" writeTo="file" enable="true"/>
Once you set that, you'll end up with a verbose log which will show specifics on when plugins are fired - useful when developing these things.
If you already did that, we'll move on to other possibilities.
Thanks, David
From: Nick Insell <bounce-nicholasinsell2570@tessituranetwork.com> Sent: 9/2/2014 10:26:37 AM
using Tessitura.Services.Common.Interceptor.Client; using Tessitura.Services.Common.Logger; namespace Tessitura.WMC.Interceptor { public class HelloInterceptor { public static PluginData Operation(PluginData input) { input.Logger.Trace("Hello World!!"); return input; }
} }
<PluginConfigs> <PluginConfig> <UriMatch>CRM/*</UriMatch> <Verb>GET</Verb> <FullPluginName>Tessitura.WMC.Interceptor.HelloInterceptor</FullPluginName> <PluginPlacement>POST</PluginPlacement> </PluginConfig> </PluginConfigs>
This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!