1

通过 SOAP 通用接口与 OTRS 3.2 服务器中的 php 和 java 访问票证及其文章信息,我没有问题。但在 xml 响应中,我没有关于文件附件的信息。

首先,根据这个 API 文档(http://otrs.github.io/doc/api/otrs/3.2/Kernel/GenericInterface/Operation/Ticket/TicketGet.pm.html),我使用了带有参数 DynamicFields 的 TicketGet 函数, Extended, AllArticles 和 Attachments 设置为 1 以获取票证,但我没有获得任何有关文章的信息。

接下来根据这个API(http://otrs.github.io/doc/api/otrs/3.2/Kernel/System/Ticket/Article.pm.html),我已经使用了ArticleIndex函数来获取Id的票文章然后 ArticleGet 获取带有附件的文章。我得到带有消息正文的文章信息,但响应中没有附件。

函数调用有问题吗?也许我缺少一些参数。或者可能存在错误的 OTRS 配置。在 Admin->System config->Framework and Ticket 选项中有很多东西需要改变。

谢谢

4

1 回答 1

4

刚刚使用OTRS Help Desk 3.3.8在OTRS Appliance 1.0.8上进行了测试,对我来说一切都很好。我可以使用TicketGet方法获取文章和附件。

请参阅以下描述如何设置OTRS Web 服务设置的文章

完成OTRS Web 服务设置后,我通过 SoapUI 将以下 SOAP 请求发送到OTRS Ticket Connector端点(在我的例子中http://192.168.112.34/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnector):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <TicketGet>
         <UserLogin>root@localhost</UserLogin>
         <Password>root</Password>
         <TicketID>965</TicketID>
         <AllArticles>1</AllArticles>
         <Attachments>1</Attachments>
    </TicketGet>
   </soapenv:Body>
</soapenv:Envelope>

并得到以下回应:

<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <TicketGetResponse xmlns="http://www.otrs.org/TicketConnector/">
      <Ticket>
        <Age>160723</Age>
        <ArchiveFlag>n</ArchiveFlag>
        <Article>
          <ArticleID>3260</ArticleID>
          <ArticleType>webrequest</ArticleType>
          ...
          <Attachment>
            <Content>
              W0dlbmVyYWxdDQpTZXJ2ZXI9Mg0KQ3JlYXRlVGFibGU9MA0KW0Rlc3RdDQpTYXZlVG9GaWxlPTEN
              ...
              aXNoXQ0KTG9hZEludG9FZGl0b3I9MA0KQ2xvc2VBZnRlckNvbXBsaXRlPTANCg==
            </Content>
            <ContentAlternative/>
            <ContentID/>
            <ContentType>text/plain</ContentType>
            <Filename>1.smt</Filename>
            <Filesize>673 Bytes</Filesize>
            <FilesizeRaw>673</FilesizeRaw>
          </Attachment>
          <Attachment>
            <Content>
              REVDTEFSRSBAUkMgaW50DQpERUNMQVJFIEBMb2dnZWRVc2VySUQgaW50DQpERUNMQVJFIEBVc2Vy
              ...
              Y2hhbmdlc1htbA0KICAsQEJhc2VDb250cmFjdHNYbWwNCkdPDQoNCg==
            </Content>
            <ContentAlternative/>
            <ContentID/>
            <ContentType>application/octet-stream</ContentType>
            <Filename>3.sql</Filename>
            <Filesize>610 Bytes</Filesize>
            <FilesizeRaw>610</FilesizeRaw>
          </Attachment>
          <AttachmentIDOfHTMLBody>3</AttachmentIDOfHTMLBody>
          <Body>sdfghhfghg</Body>
        ...
        </Article>
      ...
      </Ticket>
    </TicketGetResponse>
  </soap:Body>
</soap:Envelope>

如您所见,我收到了票的初始文章,里面有 2 个附件。

希望这有助于或毫不犹豫地提供反馈。

于 2014-08-01T17:11:51.480 回答