在 FileNET/CMIS Web 服务中调用 getContentStream() 函数

Caliing the getContentStream() function in FileNET/CMIS Web Services

我正在尝试调用 FileNET/CMIS SOAP/web 服务中的 getContentStream() 函数。它需要 2 个必需参数,一个字符串用于 repositoryID,一个字符串用于文档 ID。其余参数是可选的。方法签名是这样的:

org.oasis_open.docs.ns.cmis.ws._200908.ObjectServicePort.getContentStream(

@WebParam(name="repositoryId", 字符串 arg0,

@WebParam(name="objectId", 字符串 arg1,

@WebParam(name="streamId", 字符串 arg2,

@WebParam(name="offset", BigInteger arg3,

@WebParam(name="length", BigInteger arg4,

@WebParam(name="extension", CmisExtensionType arg5) 抛出 CmisException

在我的 Java 代码中,我有这个:

...

字符串 guid = "";

guid = request.getParameter("guid").trim();

//连接到 FileNET/CMIS Web 服务:

GetObject objRequest = new GetObject();

ObjectService objService = new ObjectService();

ObjectServicePort objectServicePort = objService.getObjectServicePort();

((SOAPBinding)((BindingProvider) objectServicePort).getBinding()).setMTOMenabled(true);

((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "用户名");

((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "密码");

((BindingProvider) objectServicePort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://filenet.web.address.there/openfncmis/services11/ObjectService");

// 调用 getContentStream():

CmisContentStreamType cmisContentStreamType = objectServicePort.getContentStream(reposName, guid, "", null, null, null);

...

当我 运行 代码时,它失败并在控制台中出现以下错误:

[10/7/21 13:52:28:724 美国东部时间] 000000db webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet 错误]-[操作]: org.oasis_open.docs.ns.cmis.ws._200908.CmisException: CIL1500: 服务无法完成。

说明:出现此错误的原因如下:

FileNET 错误日志表明:

[10/7/21 10:18:37:541 美国东部时间] 000000c1 DALP8Exceptio E com.ibm.ecm.cmis.dal.p8.DALP8ExceptionHandler handleException null

                             com.ibm.ecm.cmis.exceptions.CMISRuntimeException: CIL1500: The service cannot be completed.

说明:出现此错误的原因如下:

操作:查看 HTTP 响应或应用程序服务器 SystemOut.log 文件以获取更多信息并查看异常的堆栈跟踪。 默认情况下,SystemOut.log 文件位于应用程序服务器安装目录的 [WAS_profile_location]/logs/[server]/logs 子目录中。 在 com.ibm.ecm.cmis.dal.p8.DALP8Document.getContent(DALP8Document.java:633) 在 com.ibm.ecm.cmis.openserverfn.FnCmisService.getContentStream(FnCmisService.java:1562) 在 com.ibm.ecm.cmis.extensions.BasicPchListener.getContentStream(BasicPchListener.java:240)

at org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper.getContentStream(ConformanceCmisServiceWrapper.java:940)
at org.apache.chemistry.opencmis.server.impl.webservices.ObjectService.getContentStream(ObjectService.java:403)
at sun.reflect.GeneratedMethodAccessor205.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.run(ServiceInvokerInterceptor.java:59)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
at java.util.concurrent.FutureTask.run(FutureTask.java:277)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.run(ServiceInvokerInterceptor.java:126)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:252)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298)
at org.apache.chemistry.opencmis.server.impl.webservices.CmisWebServicesServlet.handleRequest(CmisWebServicesServlet.java:182)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1235)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:143)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:78)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:969)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1109)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:82)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:963)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:289)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:816)
at com.ibm.io.async.ResultHandler.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)

原因:java.lang.NullPointerException 在 com.ibm.ecm.cmis.dal.p8.DALP8Document.getContent(DALP8Document.java:605) ... 还有 56 个

现在,我知道文档存储库 ID 和 GUID 都很好,因为当我使用我们的 SOAP_UI 工具查询 FileNET 存储库时,我得到了一个 PDF 文档。谁能告诉我我的 Java 代码做错了什么,当我尝试在我的 Java 代码中调用 CMIS Web 服务时,我一直收到此错误?

在此先感谢您的帮助!

此致,

约翰·M·扬特

我找到问题了!

对于第三个参数,当我应该有“null”时,我有“”。

现在可以使用了!

j.