调用外部Web服务的IBM Content Collector错误 [英] IBM Content Collector error calling external Web Service
问题描述
在我当前使用IBM Content Collector 4.0.1 SP5和IBM Filenet P8 Content Engine 5.2.1的项目中,我需要从文件系统收集文件并将它们添加到某个P8的对象存储中.
在服务器上执行上载后或发生错误的情况下,我插入了WS Call Web服务任务,以便提交一些要写入数据库的数据.
配置如下:
Web服务符合 当ICC尝试调用WS时,出现HTTP/1.1 400 Bad Request错误,如下所示: 2017-10-20T13:47:10.394Z最佳[47]准备发送到的内容
网络服务:{"e:\ report \ amm_000001_00001 \ 2017 \ 10 \ 201710_amm_000001_00001_qxn_report_00_errato.pdf":{"esito":"KO","fileName":"Prova"},"e:\ report \ amm_000001_00001 \ 2017 \ 10 \ 201710_amm_000001_00001_qxn_report_00_errato.xml:{" esito:" KO," fileName:" Prova}} 我在做什么错了?
[com.ibm.afu.connector.webservice.task.InvokeServiceTask
getInputHttpEntity] [CTMS-task-12dc 44] 2017-10-20T13:47:10.456Z
最佳[48]配置:
http://192.168.8.29:8080/sirfAcq/filenet/notificaArchiviazione
fileName
esito
[com.ibm.afu.connector.webservice.task.InvokeServiceTask执行]
[CTMS-task-12dc 44] 2017-10-20T13:47:10.830Z最佳[49]调用
网络服务
URI: http://192.168.8.29:8080/sirfAcq/filenet/notificaArchiviazione
[com.ibm.afu.connector.webservice.task.InvokeServiceTask执行]
[CTMS-task-12dc 44] 2017-10-20T13:47:13.763Z最佳[50]调用
花了时间(毫秒):2933
[com.ibm.afu.connector.webservice.task.InvokeServiceTask执行]
[CTMS-task-12dc 44] 2017-10-20T13:47:13.763Z严重[51]无法执行
调用Web服务:HTTP/1.1 400错误的请求
[com.ibm.afu.connector.webservice.task.InvokeServiceTask执行]
[CTMS-task-12dc 44] 2017-10-20T13:47:13.841Z最佳[52]
[ctms-native] 2017-10-20T13:47:13Z Trace2 0x12dc调用
成功完成任务... consumes
参数;这样做将迫使WS接受通过GET或POST方法给出的每种可能的消息.
此外,我还收到了由IBM ICC和eDM L2支持提供的提示,他建议:
您的Web服务器似乎不理解该请求, 正在从ICC发送.
这是从ICC发送的请求(从您的日志片段中 提供):
{"e:\ report \ amm_000001_00001 \ 2017 \ 10 \ 201710_amm_000001_00001_qxn_report_00_errato.pdf":{"esito":"KO","fileName":"Prova"},"e:\ report \ amm_000001_00001 \ 2017 \ 10 \ 201710_amm_000001_00001_qxn_report_00_errato.xml:{" esito:" KO," fileName:" Prova}}
检查您的代码是否能够解析上面的数据.
In my current project using IBM Content Collector 4.0.1 SP5 with IBM Filenet P8 Content Engine 5.2.1 I need to collect files from file system and add them to a certain P8's object store.
After performing upload on the server or in case of error I inserted a WS Call Web Service Task in order to submit some data to be written to a database.
The configuration is the following:
The web service is REST conformant as requested in the WS Call Web Service task description page provided by IBM, follows a code excerpt:
@RequestMapping(value = "/filenet/notificaArchiviazione", method = { RequestMethod.GET,
RequestMethod.POST }, consumes = { MediaType.APPLICATION_FORM_URLENCODED_VALUE,
MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE }, produces = {
MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE })
@ResponseBody
String notificaArchiviazione(@RequestParam("fileName") String fileName, @RequestParam("esito") String esito) {
When ICC tries to call the WS I get a HTTP/1.1 400 Bad Request error like this:
2017-10-20T13:47:10.394Z FINEST [47] Prepared content to send to webservice:{"e:\report\amm_000001_00001\2017\10\201710_amm_000001_00001_qxn_report_00_errato.pdf":{"esito":"KO","fileName":"Prova"},"e:\report\amm_000001_00001\2017\10\201710_amm_000001_00001_qxn_report_00_errato.xml":{"esito":"KO","fileName":"Prova"}}
[com.ibm.afu.connector.webservice.task.InvokeServiceTask getInputHttpEntity] [CTMS-task-12dc 44] 2017-10-20T13:47:10.456Z FINEST [48] Configuration: http://192.168.8.29:8080/sirfAcq/filenet/notificaArchiviazione fileName
esito
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute] [CTMS-task-12dc 44] 2017-10-20T13:47:10.830Z FINEST [49] Invoking webservice URI:http://192.168.8.29:8080/sirfAcq/filenet/notificaArchiviazione
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute] [CTMS-task-12dc 44] 2017-10-20T13:47:13.763Z FINEST [50] Invocation took time (ms): 2933
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute] [CTMS-task-12dc 44] 2017-10-20T13:47:13.763Z SEVERE [51] Failed to invoke webservice: HTTP/1.1 400 Bad Request
[com.ibm.afu.connector.webservice.task.InvokeServiceTask execute] [CTMS-task-12dc 44] 2017-10-20T13:47:13.841Z FINEST [52] [ctms-native] 2017-10-20T13:47:13Z Trace2 0x12dc Invocation successfull, task finished...
What am I doing wrong?
Finally I managed to get it work eliminating the consumes
parameter from the annotation; doing this will force the WS to accept every kind of possible message provided it is given through a GET or POST method.
In addition I received a hint by a IBM ICC and eDM L2 support who suggested:
It appears that your web server does not understand the request that is being sent from ICC.
This is the request being sent from ICC (from the log snippet you provided):
{"e:\report\amm_000001_00001\2017\10\201710_amm_000001_00001_qxn_report_00_errato.pdf":{"esito":"KO","fileName":"Prova"},"e:\report\amm_000001_00001\2017\10\201710_amm_000001_00001_qxn_report_00_errato.xml":{"esito":"KO","fileName":"Prova"}}
Check your code if it is able to parse the data above.
这篇关于调用外部Web服务的IBM Content Collector错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!