[英]Method not implemented when calling a WebService on Weblogic 10.3
[英]Calling a Post method of a webservice
我有3個端點的Web服務。 如下 -
GET /Game/getGameAll/ (com.service.rest.Game)
GET /Game/getGameById/{gameId} (com.service.rest.Game)
POST /Game/updateGame/{gameId}/{isAvailable} (com.service.rest.Game)
為了測試,我使用-
localhost:8080/Game/getGameAll/
localhost:8080/Game/getGameById/1000
而且效果很好。
但是在執行更新功能時-
localhost:8080/Game/updateGame/1000/true
它給我一個錯誤404:方法未找到。
但是,如果我將注釋從post更改為get。 它執行。
//@POST : If this is changed to Get, it works! But not with @POST.
@GET
@Path(value = "/updateGame/{gameId}/{isAvailable}")
@Produces(MediaType.APPLICATION_JSON)
public Game updateGame(
@PathParam(value = "gameId") Integer gameId,
@PathParam(value = "isAvailable") int isAvailable) { ..
.
}
如何執行Web服務的Post方法?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.