让简单的JAX-RS/CXF POST示例发挥作用

让简单的JAX-RS/CXF POST示例发挥作用,post,cxf,jax-rs,Post,Cxf,Jax Rs,我正在尝试使用一个简单的CXF Rest Web服务来处理POST。webservice接口如下所示: @Produces("application/json") @Consumes("application/x-www-form-urlencoded") @POST @Path("/postExample") public Info postExample(String id); var header:URLRequestHeader = new URLRequestHeader("C

我正在尝试使用一个简单的CXF Rest Web服务来处理POST。webservice接口如下所示:

@Produces("application/json")
@Consumes("application/x-www-form-urlencoded")
@POST
@Path("/postExample")   
public Info postExample(String id);
var header:URLRequestHeader = new URLRequestHeader("Content-Type", "application/x-www-form-urlencoded");
var request:URLRequest = new URLRequest("http://localhost:8080/XXXX/postExample");
var variables:URLVariables = new URLVariables();
variables.id= abc;
request.data = variables;   
request.method = URLRequestMethod.POST;
request.requestHeaders.push(header);
try {
    loader.load(request);
} catch (error:Error) {
    trace("Unable to load requested document.");
}
我也尝试过使用“text/plain”的@Consumes。 现在我从Flash AS3调用webservice,如下所示:

@Produces("application/json")
@Consumes("application/x-www-form-urlencoded")
@POST
@Path("/postExample")   
public Info postExample(String id);
var header:URLRequestHeader = new URLRequestHeader("Content-Type", "application/x-www-form-urlencoded");
var request:URLRequest = new URLRequest("http://localhost:8080/XXXX/postExample");
var variables:URLVariables = new URLVariables();
variables.id= abc;
request.data = variables;   
request.method = URLRequestMethod.POST;
request.requestHeaders.push(header);
try {
    loader.load(request);
} catch (error:Error) {
    trace("Unable to load requested document.");
}
我希望webservice应该接收字符串“abc”,但是它接收字符串“id=abc”。有人能帮我理解这里出了什么问题吗

问候,, JS

附言:让它起作用了。更新了Web服务接口以 public Info postExample(@FormParam(“id”)String id))