【发布时间】:2018-09-15 09:31:29
【问题描述】:
拜托,这是您关心的问题:我想知道如何使用 postman 查询如下代码中定义的 Web 服务以进行测试。 PS:我无法更改方法签名
我有这样的网络服务:
@POST
@Path("/uploadOpenAccountRequestFiles/{requestId}")
@Consumes({MediaType.APPLICATION_JSON,MediaType.MULTIPART_FORM_DATA})
public Response uploadOpenAccountRequestFiles(@PathParam("requestId") String requestId,
MultipartFormDataInput multipartFormDataInput)
throws JsonGenerationException, JsonMappingException, IOException {
initContext();
logger.info("DIGIBANK : uploadOpenAccountRequestFiles END: ");
String msge = "";
try {
digiBean.saveToserver(requestId, multipartFormDataInput);
} catch (Exception e) {
msge = e.getMessage();
e.printStackTrace();
}
org.af.webservice.Response resp = new org.af.webservice.Response(
request.getSession().getId(), "uploadOpenAccountRequestFiles", "",
msge.equalsIgnoreCase("OK") ? true : false, msge.equalsIgnoreCase("OK") ? false : true, "",
msge.equalsIgnoreCase("OK") ? true : false, "Boolean", msge);
logger.info("DIGIBANK : uploadOpenAccountRequestFiles END: ");
return Response.ok().entity(mapper.writeValueAsString(resp)).build();
}
这是我的配置图片:
【问题讨论】:
-
您好,感谢您抽出宝贵时间,我尝试这样发送请求:192.168.202.210:8080/afb-fintech-api/rest/agentbanking/…;然后按照您上面提到的链接上的示例,我收到此错误:HTTP 415 - Unsupported Media Type.
-
拜托,我没有在 headers.and body 中选择内容类型,只是 form-data 和文件被选中