OTRS Webservice as test request

I am new to OTRS (3.2) as well as new to PERL, but I was tasked with setting up OTRS to call our remote web service so that a record can be created at our end when the ticket is set to "Closed". I have configured various dynamic fields so the customer service representative can fill in additional details that will be passed to the webservice call along with the ticket information. I couldn't get the webservice call to fire when the ticket was "Closed", but I got it to start when the "priority" was changed, so I'm just using that for now to test the web service. I am just using the Test.pm and TestSimple.pm files that were included with OTRS.

When I look at Debugger for Webserice I see that calls have been made:

   $VAR1 = {
      'TicketID' => '6'
   };

      

My webservice currently only has one "create" method that just returns true for testing.

however I am getting the following from Test.pm

"Didn't receive TicketNumber (2014-09-02 09:20:42, error)"

and the following from TestSimple.pm

"Error in SOAP call: 404 Not found at /TARGET/SHARE/var/otrs/Kernel/GenericInterface/Transport/HTTP/SOAP.pm line 578 (2014-09-02 09:20:43, error)

I've spent countless hours on Google but couldn't find anything. All I could find was the code for Test.pm and TestSimple.pm, but nothing really helpful to help me create a custom call for my needs and configure a web service in OTRS to get it working.

Does anyone have sample invokers that I can look at how to set it up?

Basically I need to pass ticket information along with my custom dynamic fields to my web service. From there I can create a record at my end and do any processing. I'm not sure how to set up Invoker to pass in the required ticket and dynamic fields, and how to get it to call a specific method on my remote webservice.

I think getting Test.pm and TestSimple.pm to work is the first step, after which I can change the ones I need. I haven't used PERL at all, so any help is greatly appreciated.

+3


source to share


1 answer


I am struggling with a similar set of requirements too. I also never programmed in PERL, but I can tell you that the "Got no TicketNumber" in Test.pm is right from the PrepareRequest method, you can see this block of code there:

# we need a TicketNumber
if ( !IsStringWithData( $Param{Data}->{TicketNumber} ) ) {
   return $Self->{DebuggerObject}->Error( Summary => 'Got no TicketNumber' );
}

      

You should change all references to TicketNumber to TicketID or remove validation altogether (there is also a mapping to the ReturnedData variable).



Calling concrete methods on your WS interface is pretty straightforward (but poorly documented). The Invoker name specified in the "OTRS as requester" section of the web service configuration corresponds to the WS method that will be called. So if you have a WS interface using the "create" method, just call Invoker "create".

As for collecting dynamic field, it can't help you with that, sorry.

Greetings

0


source







All Articles