3

I have configured the generic ticket connector with the data mapping set to simple/xslt/empty and i get empty response for the curl calls. I could see the request is being received by the server but it is not responding. Can someone help me figuring this out.

My configuration on server side from https://github.com/OTRS/otrs/tree/master/development/webservices

---
Debugger:
  DebugThreshold: debug
  TestMode: '0'
Description: Manage remote tickets
FrameworkVersion: 5.0.20
Provider:
  Operation:
    CreateTicket:
      Description: Create remote tickets
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketCreate
    Get ticket:
      Description: Get ticket
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketGet
    Sessioncreate:
      Description: create remote session
      MappingInbound: {}
      MappingOutbound: {}
      Type: Session::SessionCreate
  Transport:
    Config:
      KeepAlive: ''
      MaxLength: '1000000000'
      RouteOperationMapping:
        CreateTicket:
          RequestMethod:
          - POST
          Route: /Ticket
        Get ticket:
          RequestMethod:
          - GET
          Route: /Ticket/:TicketID
        Sessioncreate:
          RequestMethod:
          - POST
          Route: /Session
    Type: HTTP::REST
RemoteSystem: ''
Requester:
  Transport:
    Type: ''

Curl Call from Remote system as per the documentation:

curl "http://otrs.com/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/6000?UserLogin=agent&Password=123"

The output of the curlcall:

curl: (52) Empty reply from server

coolkrish91
  • 31
  • 1
  • 4

2 Answers2

2

I've got the same error and was able to solve it by using following scheme for the URL:

http://otrs.com/otrs/nph-genericinterface.pl/Webservice/[Web Service Name]/[Operation Name]/[Variable]?UserLogin=[Agent Login]&Password=[Agent Password]

The placeholders are taken from the Web Service Configuration in the OTRS settings:

Web Service and Operation Names

And the mapping of the variables can be configured by using the "Configure" button which leads to this form:

Vriable configuration

e.g. if the OTRS URL is localhost, the Web Service name is Foobar, the agent login is agent and his/her password is 123456 a curl request could look like (given that the command TicketGet is configured as shown in the screenshots):

curl "https://localhost/otrs/nph-genericinterface.pl/Webservice/Foobar/TicketGet/10235?UserLogin=agent&Password=123456"
Martin M.
  • 707
  • 7
  • 16
0

Perl nph (non parsed headers) scripts must have PerlSendHeader set to off in apache configuration. Include something like this:

<Location /otrs/nph-genericinterface.pl>
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
    PerlSetupEnv On

    PerlSendHeader Off

    Options +ExecCGI
</Location>