Is anyone aware of a guide to writing service interceptors? I have the REST API Documentation which has a small section, but really looking for information on what references I need to include, how to setup the development environment, any actions such as user authentication that need to be completed?
A HelloWorld interceptor tutorial that goes through these would be so helpful if anyone has one...
Sergei
Thanks a lot for this information. We managed to get something working with a lot of trial an error, but this short list of steps will help us get rid of a lot of extra tasks that we did while we were trying to get things to work (ie. throwing punches in the dark). This is very helpful.
Fernando Margueirat Business Analyst The National Ballet of Canada 470 Queens Quay West Toronto, Ontario M5V 3K4 P: 416 345 9686 x453 F: 416 345 8323
From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Sergei Stenkov Sent: October-25-12 1:19 AM To: Fernando Margueirat Subject: Re: [Tessitura Technical Forum] Service Interceptor Guide
Hi Everyone,
After much turmoil we finally managed to implement a “Hello world” interceptor that just writes a text file to hard drive. I hope it helps someone.
1. Start a new class library project in VS and name it TestPluginCSharp.
2. Copy Tessitura.Services.Common.Interceptor.Client.dll from your Tessitura service (the one that you are building plug-in for e.g. ConstituentService) bin folder to your new class library bin folder and add project reference to it.
3. Add a class named TestPluginCSharp and add the following code:
using Tessitura.Services.Common.Interceptor.Client;
namespace TestPluginCSharp
{
public class TestPluginCSharp
public static PluginData Operation(PluginData pluginData)
//you'll need the folder set up somewhere on the server for your test file
System.IO.File.WriteAllText(@"C:\Test\test.txt", "Howdy!");
return pluginData;
}
4. Build your project
5. Copy TestPluginCSharp.dll from bin\Debug folder to the service Plugins folder (e.g. ConstituentService\Plugins).
6. Open PluginConfig.xml from ConstituentService\Plugins in your VS and add:
<PluginConfigs>
<PluginConfig>
<UriMatch>Constituents/*</UriMatch>
<Verb>GET</Verb>
<FullPluginName>TestPluginCSharp.TestPluginCSharp</FullPluginName>
<PluginPlacement>PRE</PluginPlacement>
</PluginConfig>
</PluginConfigs>
Note: no preceding forward slash in UriMatch
7. Save PluginConfig
8. You may need to restart Application Pool for Tess in IIS
9. I also have EnablePlugins and ReloadPluginConfig keys set to true in Web.config of the service.
10. In Firefox start RESTClient. Set up OAuth Authorisation as per REST_API_Documentation.doc
11. Set call method to GET
12. Set to address of your service (e.g. https://your_server/Tess/ConstituentService/Constituents/60671061 ) and send request.
13. This should result in test.txt being written to the path at step 2.
Good luck!
Sergei Stenkov
From: Simon Davidson <bounce-simondavidson9902@tessituranetwork.com> Sent: 8/29/2012 3:45:10 AM
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!