【发布时间】:2013-11-05 01:49:44
【问题描述】:
我有一个重定向到 REST Java Web 服务的 http 端点。 我收到一个 application/x-www-form-urlencoded 请求,请求正文中嵌入了一些属性。
在 Web 服务中,我想使用这些属性更新 mule 消息状态。 由于 RequestContext.getEventContext() 现在已弃用,而 Doc 说要实现 Callable,但对我来说似乎不起作用。永远不会调用 onCall 方法。
有什么想法吗?
在我的代码下面:
enter code here
@Path("/restClass")
public class HelloREST implements Callable{
private String industry;
private String lob;
private String nuixlegalentity;
private org.apache.log4j.Logger log = Logger.getLogger(LoadClass.class);
@POST
@Path("/setPayload")
@Consumes("application/x-www-form-urlencoded")
public void setMessage(@FormParam("industry") String industryParam, @FormParam("lob") String lobParam,@FormParam("nuixlegalentity") String nuixlegalentityParam){
log.debug("**************INSIDE SETMESSAGE******************");
industry=industryParam;
lob=lobParam;
nuixlegalentity=nuixlegalentityParam;
}
@Override
public Object onCall(MuleEventContext eventContext) throws Exception{
log.debug("**************INSIDE ONCALL******************");
eventContext.getSession().setProperty("industry","industry");
eventContext.getSession().setProperty("lob",lob);
eventContext.getSession().setProperty("nuixlegalentity",nuixlegalentity);
return eventContext.getMessage();
}
}
}
【问题讨论】:
标签: java rest mule mule-studio