我正在休息Web服务,并且正在通过FF中的Rest Client执行它。截至目前,它被用来作为后法现在我已经改变它的输入类型到JSON即现在我发送JSON输入到WS但其余客户端上我得到将休息Web服务的输入类型设置为Json
Status Code: 415 Unsupported Media Type
Connection: Keep-Alive
Content-Length: 0
Content-Type: text/plain
Date: Wed, 28 Aug 2013 07:52:50 GMT
Keep-Alive: timeout=5, max=99
Server: Apache/2.2.19 (Win32) mod_jk/1.2.30 PHP/5.3.6
下面是WS新的签名(我已经添加了消费和生产线)
@Override
@POST
@Path("/addHouseHoldAccounts")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response addHouseHoldAccounts(JSONObject jsonObject) {
....
....
}
其余客户端上我已经设置页眉Content-Type application/json
以下是JSON输入我试图发送
{
"jsonObject":{
"JsonId":"17fb00b6-dfa3-4cc6-b7ba-c54ecd429350",
"JsonTypeOf":"JSonTest",
"JsonType":"",
"JsonTypetName":"JsonImplemented"
}
}
任何人都可以指出我的错误或为我提出解决方案来实现这一点。