AnsweredAssumed Answered

Creating Documents Using CreateDocument Web Service

Question asked by amitgoda on Apr 26, 2013
Latest reply on May 1, 2013 by amitgoda
Hello Everyone,

I am using Alfresco Community 4.2 version. I am using CreateDocument web service to create different documents in my alfresco share. I am using the web service and passing relevant data for each document.

I have 2 questions about it,

1.) What should be the encoding type for documents, like MS-Word, MS-Excel, JPEG, PNG? I tried creating word document with encoding type as ISO-8859-1 but the document that formed do not have english characters. For e.g for the following content in doc

<strong>This file is created using create document web service</strong>

I am getting the following content in the document that got created in share contains some invalid characters.

So can anyone tell what encoding should I use.I have also tried with UTF-8 and UTF-16, but still facing the same issue.

2.) When I create document with the name which doesnt have spaces like <strong>TestDoc</strong> than the document is created properly, but when I try to create a document with space character in the name like <strong>Test Doc</strong> than Alfresco returns with the following error

<ns1:errorCode>0</ns1:errorCode><ns1:message>org.alfresco.service.cmr.repository.XPathException: 03260166 Error executing xpath: 
   xpath: /app:company_home/st:sites/cm:site-demo/cm:documentLibrary/cm:Test Doc</ns1:message></ns1:RepositoryFault><ns2:exceptionName xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://xml.apache.org/axis/">org.alfresco.repo.webservice.repository.RepositoryFault</ns2:exceptionName><ns3:stackTrace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://xml.apache.org/axis/">
   at org.alfresco.repo.webservice.repository.RepositoryWebService.update(RepositoryWebService.java:335)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
   at java.lang.Thread.run(Thread.java:722)


Can anyone explain why I am unable to create document with name which has space characters ?

Thanks in advance!!!

Outcomes