Создание заявки через web-service REST

Обсуждение вопросов и решений

Модератор: ykolesnikov

Ответить
asergey
OTRS Новобранец
Сообщения: 1
Зарегистрирован: 27 июн 2017, 15:07

Создание заявки через web-service REST

Сообщение asergey » 29 июн 2017, 15:42

Здравствуйте.

Уважаемые коллеги, нужна помощь в решении следующей задачи:

В данный момент есть сервачок с установленной Ubuntu 16
4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
на него установлена otrs 5 free из штатных пакетов

в данный момент по наущению доки настроил веб-сервис, пример взял отсюда https://github.com/OTRS/otrs/tree/maste ... ebservices
использовал GenericTicketConnectorREST.yml

Код: Выделить всё

---
Debugger:
  DebugThreshold: info
  TestMode: '0'
Description: Ticket Connector REST Sample
FrameworkVersion: 5.0.x git
Provider:
  Operation:
    SessionCreate:
      Description: Creates a Session
      MappingInbound: {}
      MappingOutbound: {}
      Type: Session::SessionCreate
    TicketCreate:
      Description: Creates a Ticket
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketCreate
    TicketGet:
      Description: Retrieves Ticket data
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketGet
    TicketGetList:
      Description: Retrieves Ticket data for a List of Ticket IDs
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketGet
    TicketSearch:
      Description: Search for Tickets
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketSearch
    TicketUpdate:
      Description: Updates a Ticket
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketUpdate
  Transport:
    Config:
      KeepAlive: ''
      MaxLength: '100000000'
      RouteOperationMapping:
        SessionCreate:
          RequestMethod:
          - POST
          Route: /Session
        TicketCreate:
          RequestMethod:
          - POST
          Route: /Ticket
        TicketGet:
          RequestMethod:
          - GET
          Route: /Ticket/:TicketID
        TicketGetList:
          RequestMethod:
          - GET
          Route: /TicketList
        TicketSearch:
          RequestMethod:
          - GET
          Route: /Ticket
        TicketUpdate:
          RequestMethod:
          - PATCH
          Route: /Ticket/:TicketID
        TicketHistoryGet:
          RequestMethod:
          - GET
          Route: /TicketHistory/:TicketID
    Type: HTTP::REST
RemoteSystem: ''
Requester:
  Transport:
    Type: ''
скормить пытался данные вот такого содержания:

Код: Выделить всё

{
   "Ticket" : {
      "Queue" : "Raw",
      "Priority" : "3 normal",
      "CustomerUser" : "max",
      "Title" : "REST Create Test",
      "State" : "open",
      "Type" : "Unclassified"
   },
   "Article" : {
      "ContentType" : "text/plain; charset=utf8",
      "Subject" : "Rest Create Test",
      "Body" : "This is only a test"
   }
}
скармливал вот такой строчкой:

Код: Выделить всё

curl "http://localhost/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=test&Password=test" -H "Content-Type: application/json" -d @create_ticket.json
но как я ни пытался им воспользоваться у меня все время вылетает вот такая ошибка в syslog:

Код: Выделить всё

Jun 29 17:34:26 fzd GenericInterfaceProvider-10[1494]: [Error][Kernel::GenericInterface::Transport::new][Line:76]: ???
Jun 29 17:34:27 fzd GenericInterfaceProvider-10[1494]: [Error][Kernel::GenericInterface::Debugger::DebugLog][Line:218]: DebugLog error:  Summary: Backend Kernel::GenericInterface::Transport::HTTP::REST not found.  Data   : No data provided.
Jun 29 17:34:27 fzd GenericInterfaceProvider-10[1494]: [Error][Kernel::GenericInterface::Debugger::DebugLog][Line:218]: DebugLog error:  Summary: TransportObject could not be initialized  Data   : $VAR1 = {  'ErrorMessage' => 'Backend Kernel::GenericInterface::Transport::HTTP::REST not found.',  'Success' => 0};.
В дебаге сервиса то же самое, только в другом оформлении.
Пользователь для проверки создан, агент с другим именем для проверки так же есть, но это не спасает.

Я понимаю что я что то делаю не правильно, но вопрос что именно и куда копать.

Заранее спасибо за помощь.

Ответить