Service Interceptor Help!

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

 

 

 

Parents
  • Thanks guys,  I managed to get the plugin to fire.  Not sure why the URI wouldn’t match but have at least got it to work.  I was pulling my hair out trying to get this to work.

     

    2014-09-03 09:49:25.8535|Debug|Using item with key 'TS:CK:AllDefaultEntities' from the cache.

    2014-09-03 09:49:25.8535|Debug|Using item with key 'TS:CK:AllDefaultEntities' from the cache.

    2014-09-03 09:49:25.8535|Debug|Using item with key 'TS:CK:AllDefaultEntities' from the cache.

    2014-09-03 09:49:25.8535|Debug|Using item with key 'TS:CK:AllDefaultEntities' from the cache.

    2014-09-03 09:49:25.8535|Debug|STARTING PLUGIN: Tessitura.WMC.Interceptor.HelloInterceptor

    2014-09-03 09:49:25.8535|Trace|Hello World!!

    2014-09-03 09:49:25.8535|Debug|ENDING PLUGIN: Tessitura.WMC.Interceptor.HelloInterceptor

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Nick Insell
    Sent: 03 September 2014 09:38
    To: Nick Insell
    Subject: RE: [Tessitura Technical Forum] Service Interceptor Help!

     

    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:09.4404|Debug|Using item with key 'TS:CK:AllDefaultEntities' from the cache.

    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

    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

     

     

     




    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!





    Pob cytundeb yn amodol ar gontract. Mae’n rhaid i unrhyw geisiadau caffael gael Archeb Swyddogol gyda Rhif Archeb Swyddogol er mwyn iddo fod yn ddilys.

    Mae’r ohebiaeth hon at ddefnydd y derbynnydd/derbynyddion bwriadedig yn unig. Os nad chi yw’r derbynnydd/derbynyddion bwriadedig, nodwch fod dosbarthu, copïo neu ddefnyddio’r ohebiaeth hon neu’r wybodaeth ynddi mewn unrhyw ffordd wedi ei wahardd yn gyfangwbl a gall fod yn anghyfreithlon. Os ydych wedi derbyn yr ohebiaeth hon trwy gamgymeriad a fyddech cystal â’i ddychwelyd i’r anfonwr. Yn yr achos hwn byddem yn ddiolchgar pe gallech hefyd anfon yr ohebiaeth at administrator@wmc.org.uk ac yna dileu’r e-bost a dinistrio unrhyw gopïau ohono. Cwmni cyfyngedig dan warrant, cofrestrwyd yng Nghymru a Lloegr. Rhif Cwmni 3221924. Rhif Elusen 1060458. Swyddfa gofrestredig: Plas Bute, Bae Caerdydd, Caerdydd CF10 3AL


    All agreements are subject to contract. A signed Official Order with an Official Order number must accompany any procurement request for it to be valid.

    This communication is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful.If you have received this communication in error please return it to the sender. In this event would be grateful if you would also copy the communication to administrator@wmc.org.uk then delete the email and destroy any copies of it. A company limited by guarantee, registered in England and Wales. Company number 3221924. Charity number 1060458. Registered office: Bute Place, Cardiff Bay, Cardiff CF10 5AL




    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!

  • Hi Nick,

    I see you figured this out. What did you do to resolve the URI matching? I am experiencing the exact same issue.

    Thanks!

    Matt

Reply Children