Custom operation backend for GenericInterface not working

Moderator: crythias

Locked
JSouzaF
Znuny newbie
Posts: 10
Joined: 31 Jul 2015, 20:16
Znuny Version: OTRS 5.0.7
Company: UFJF

Custom operation backend for GenericInterface not working

Post by JSouzaF »

Hi,

I'm trying to create a custom operation module for using with my OTRS's webservice as a provider. In order not to mess with the original files, I decided to create a new folder under Kernel/GenericInterface/Operation/ called MyOp.

Just for testing matters to check if I could register and use this new operation, I copied the two files from Kernel/GenericInterface/Operation/Session/ to my new folder and renamed SessionCreate.pm to MyAuth.pm. So, my folder Kernel/GenericInterface/Operation/MyOp/ has the files: Common.pm and MyAuth.pm.

In Common.pm, I changed only the package line with the correct new package name:

Code: Select all

package Kernel::GenericInterface::Operation::MyOp::Common;
In MyAuth.pm, i did the same things where I should:

Code: Select all

package Kernel::GenericInterface::Operation::MyOp::MyAuth;

use base qw(
    Kernel::GenericInterface::Operation::Common
    Kernel::GenericInterface::Operation::MyOp::Common
);
So, MyAuth has everything Session::SessionCreate has and should work just like it.

I also put this inside GenericInterface.xml:

Code: Select all

    <ConfigItem Name="GenericInterface::Operation::Module###MyOp::MyAuth" Required="0" Valid="1">
        <Description Translatable="1">GenericInterface module registration for the operation layer.</Description>
        <Group>GenericInterface</Group>
        <SubGroup>GenericInterface::Operation::ModuleRegistration</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Name">MyAuth</Item>
                <Item Key="Controller">MyOp</Item>
                <Item Key="ConfigDialog">AdminGenericInterfaceOperationDefault</Item>
            </Hash>
        </Setting>
    </ConfigItem>
I configured the webservice using the WebInterface. Everything I configured and tested with Session::SessionCreate works fine. But, when trying to use MyAuth, I get the following:

Code: Select all

Dec  7 16:21:00 localhost GenericInterfaceProvider-10[16795]: [Error][Kernel::GenericInterface::Operation::new][Line:92]: ???
Dec  7 16:21:00 localhost GenericInterfaceProvider-10[16795]: [Error][Kernel::GenericInterface::Debugger::DebugLog][Line:219]: DebugLog error:  Summary: Can't load operation backend module Kernel::GenericInterface::Operation::MyOp::MyAuth!  Data   : No data provided.
Dec  7 16:21:00 localhost GenericInterfaceProvider-10[16795]: [Error][Kernel::GenericInterface::Debugger::DebugLog][Line:219]: DebugLog error:  Summary: Operation could not be initialized  Data   : $VAR1 = {  'ErrorMessage' => 'Can\'t load operation backend module Kernel::GenericInterface::Operation::MyOp::MyAuth!',  'Success' => 0};.
I've done so many tests trying to figure out whats wrong but couldn't. One thing that I noticed is, if in MyAuth.pm I change the base to use "Session::Common" instead of "MyOp::Common" it works, even though both are the same thing. I wonder if there's somewhere else I should put information about the module or anything else.

Sorry for the long post but I tried to explain everything. Any ideas??

Using OTRS 4.0.8 and trasnport as HTTP::Rest.
JSouzaF
Znuny newbie
Posts: 10
Joined: 31 Jul 2015, 20:16
Znuny Version: OTRS 5.0.7
Company: UFJF

Re: Custom operation backend for GenericInterface not working

Post by JSouzaF »

Here goes a pastebin with apache's error log, if anyone can help..

http://pastebin.com/p52uGnEU
Toqe
Znuny newbie
Posts: 1
Joined: 26 Nov 2016, 15:34
Znuny Version: 5.0.14
Real Name: Tobias

Re: Custom operation backend for GenericInterface not working

Post by Toqe »

By now this thread is outdated, but because it still has a very high Google rank:

I've just come across this problem and in my case it was a syntax error in one of my custom perl scripts.
I could solve it by using

Code: Select all

perl - c path/to/my/File.pm
on the command line which gave me the hint I needed.
In my case I just used $Param->{UserID} instead of $Param{UserID}, which means I could use some more perl practice ;)

Please note the hint from http://stackoverflow.com/questions/1290 ... ion-errors that using perl -c should only be used on code from a trusted source, as it may already execute some code.
Locked