我可以在我的getsandbox(https://getsandbox.com/)状态变量(全局)中存储简单的普通xml,但是在使用soap信封存储soap消息时遇到了挑战。这是我试过的代码。
state.data = state.data || "";
Sandbox.define('/postxmldata', 'POST', function(req, res) {
this.state.data = req.xmlDoc;
console.log("data:"+this.state.data);
this.state.test.push(this.state.data+"");
res.type("application/xml");
return res.send(this.state.data);
});
这是我的模拟API的链接 - http://dark-wildflower-1658.getsandbox.com/postxmldata