Search code examples
.netperlweb-serviceswcfotrs

Calling a WCF service from OTRS when a ticket is changed


I need to make SOAP requests from OTRS 3.3 to a WCF service I'm currently implementing when a ticket in OTRS is created, changed or deleted. I need it for sending emails containing information about the changed ticket. Therefore, it would be nice that this SOAP request contained full information about the ticket.

All I can find after googling is that OTRS has invokers mechanism that can be configured to call SOAP services when a desirable event is fired including ticket creation, changing or deleting.
But when I go to the Admin -> Web Services -> My service, there is no invokers in the Add Invoker dropdown under the OTRS as requestor section.

What should I do next in order to attach an invoker that makes SOAP request with information about changed ticket? Or latest OTRS version doesn't contain invokers out of the box and I have to implement it by myself using Perl programming language?


Solution

  • Basically what you need to do before having an invoker available is to activate it. You can do this from OTRS administration in the SysConfig section, in the left column you select GenericInterface and then a table is displayed where you select GenericInterface::Invoker::ModuleRegistration. There you can activate your available Invokers.

    Then you probably run into another problem and that is how you register your custom invoker with OTRS so you can activate it. The simple "starter guide" could be described as follows:

    1. make a copy of Test.pm in /opt/otrs/Kernel/GenericInterface/Invoker/Test and name it MyPrettyInvoker.pm (let it reside in the same directory for now)
    2. change the package name in MyPrettyInvoker.pm to reflect the name of the Invoker
    3. add record for MyPrettyInvoker in /opt/otrs/kernel/Config/GenericInterface.xml which will register the new operation with OTRS; basically just copy/paste and adjust the record which is already present for the Test invoker which you initially copied
    4. now you can enable the operation in otrs Admin section (SysConfig > GenericInterface > GenericInterface::Invoker::ModuleRegistration)
    5. your new MyPrettyInvoker is now ready to be used from WebServices configuration screen