在wso2 esb类中介中,我得到空的请求 .
公共类HandleJSONPayload扩展AbstractMediator {
public boolean mediate(MessageContext context) {
try {
org.apache.axis2.context.MessageContext axis2MessageContext = ((Axis2MessageContext) context).getAxis2MessageContext();
JSONObject jsonPayload = new JSONObject(JsonUtil.jsonPayloadToString(axis2MessageContext));
**System.out.println("o/p--------->"+jsonPayload.toString());**
//setting the payload as the message payload
JsonUtil.getNewJsonPayload(axis2MessageContext, jsonPayload.toString(), true, true);
} catch (Exception e) {
handleException("Error while mediating the message", e, context);
}
return true;
}
}
我正在打印的o / p给出空的json({}) . 但在许多文章中我发现这是获取信息的方式 .