简单问题:
- 我有一个webMethods“REST服务”(_post)。
- 在“REST服务”服务中,我调用了一个自编写的Java服务。
- 在Java服务内部,我想获取请求的原始主体。
有什么想法吗?
简单问题:
有什么想法吗?
InvokeState is = InvokeState.getCurrentState();
byte[] bytesIn = (byte[])is.getPrivateData("$msgBytesIn");
String body = null;
if (bytesIn!=null) {
body = new String(bytesIn, StandardCharsets.UTF_8);
}
// body now contains the request body
例子2,对于Content-Type: multipart/form-data
:
IDataCursor pipelineCursor = pipeline.getCursor();
InputStream bodyStream = (InputStream)IDataUtil.get( pipelineCursor, "contentStream" );
pipelineCursor.destroy();
// bodyStream now contains the request body