OTRS Web服务作为请求者测试 [英] OTRS Webservice as Requestor Test

查看:252
本文介绍了OTRS Web服务作为请求者测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是OTRS(3.2)的新手,也是PERL的新手,但是我已经得到了设置OTRS的任务,以便它可以调用我们的远程Web服务,以便在票证设置为已关闭". 我设置了各种动态字段,以便客户服务代表可以填写其他数据,这些数据将与故障单详细信息一起传递到Web服务调用中. 当票证关闭"时,我无法触发webservice调用,但是当优先级"更改时,我确实触发了它,因此我现在仅使用它来测试webservice. 我只是使用OTRS随附的Test.pm和TestSimple.pm文件.

I'm new to OTRS (3.2) and also new to PERL but I have been given the task of setting up OTRS so that it will make a call to our remote webservice so a record can be created on our end when a ticket is set as "Closed". I set up various dynamic fields so the customer service rep can fill in additional data that will be passed into the webservice call along with ticket details. I couldn't get the webservice call to trigger when the ticket was "Closed" but I did get it to trigger when the "priority" was changed so I'm just using that now to test the webservice. I'm just using the Test.pm and TestSimple.pm files that were included with OTRS.

当我查看Webserice的调试器时,可以看到正在进行调用:

When I look at the Debugger for the Webserice, I can see that the calls were being made:

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

我的网络服务目前只有一种创建"方法,该方法返回true进行测试.

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

但是我从Test.pm中获得了以下内容

however I get the following from the Test.pm

没有票证号码(2014-09-02 09:20:42,错误)"

"Got no TicketNumber (2014-09-02 09:20:42, error)"

以及来自TestSimple.pm的以下内容

and the following from the TestSimple.pm

"SOAP调用中的错误:在/TARGET/SHARE/var/otrs/Kernel/GenericInterface/Transport/HTTP/SOAP.pm第578行中找不到404(2014-09-02 09:20:43,错误)

"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)

我在Google上花费了无数小时,但找不到任何东西.我所能找到的只是Test.pm和TestSimple.pm的代码,但是没有什么真正有用的方法来帮助我根据需要创建自定义调用程序并在OTRS中配置Web服务以使其正常工作.

I've spent countless hours on Google but couldn't find anything on this. All I could find is code for the Test.pm and TestSimple.pm but nothing really helpful to help me create a custom invoker for my needs and configure the webservice in OTRS to get it to work.

有人可以查看任何示例调用程序以了解如何进行设置吗?

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

基本上,我需要将票证信息以及自定义动态字段传递到我的Web服务.从那里,我可以在一端创建记录并进行任何处理. 我不确定如何设置调用程序以传递必要的票证字段和动态字段,以及如何使其调用我的远程Web服务中的特定方法.

Basically I need to pass the ticket information along with my custom dynamic fields to my webservice. From there I can create the record on my end and do whatever processing. I'm not sure how to setup the Invoker to pass the necessary ticket fields and dynamic fields and how to make it call a specific method in my remote webservice.

我想让Test.pm和TestSimple.pm正常工作是第一步,然后我可以根据自己的需要进行修改.我根本没有使用过PERL,因此不胜感激.

I guess getting the Test.pm and TestSimple.pm to work is the first step then I can modify those for my needs. I have not used PERL at all so any help is greatly appreciated.

推荐答案

我也正在努力解决类似的要求.我也从未在PERL中进行编程,但是我至少可以告诉您Test.pm中的不获取票证编号"恰好来自PrepareRequest方法,在那里您可以看到以下代码块:

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

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

您应该将对TicketNumber的所有引用都更改为TicketID,或删除任何验证(也有到ReturnedData变量的映射).

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

在WS界面上调用特定方法非常简单(但文献记载很少).您在Web服务配置的"OTRS作为请求者"部分中指定的Invoker名称与将被调用的WS方法相对应.因此,如果您的WS接口带有一个名为"create"的方法,则只需将Invoker也命名为"create".

Invoking specific methods on your WS interface is quite simple (but poorly documented). The Invoker name that you specify in the "OTRS as requester" section of web service configuration corresponds to the WS method that will be called. So if you have WS interface with a method called "create" just name the Invoker "create" too.

就动态领域的发展而言,抱歉,还不能帮助您.

As far as the gathering of dynamic field goes, can't help you on that one yet, sorry.

欢呼

这篇关于OTRS Web服务作为请求者测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆