cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with CML create

gressho
Champ in-the-making
Champ in-the-making
Hi,

I've serious problems in creating a document with CML. I'm using JAX-WS (and I've seen I'm not the only one), so I hope there are answers. My client
produces the following body:

<ns3:update xmlns="http://www.alfresco.org/ws/cml/1.0" xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0" xmlns:ns3="http://www.alfresco.org/ws/service/repository/1.0"><ns3:statements><create><id>create_1</id><parent><ns2:store><ns2:scheme>workspace</ns2:scheme><ns2:address>SpacesStore</ns2:address></ns2:store><ns2:uuid>6d9ed674-982f-48c6-b2f3-b2d43fc185c8</ns2:uuid><ns2:associationType>{http://www.alfresco.org/model/content/1.0}contains</ns2:associationType></parent><type>text/xml</type><property><ns2:name>{http://www.alfresco.org/model/content/1.0}name</ns2:name><ns2:isMultiValue>false</ns2:isMultiValue><ns2:value>Test</ns2:value></property><property><ns2:name>{http://www.alfresco.org/model/content/1.0}title</ns2:name><ns2:isMultiValue>false</ns2:isMultiValue><ns2:value>Test</ns2:value></property><property><ns2:name>{http://www.alfresco.org/model/content/1.0}description</ns2:name><ns2:isMultiValue>false</ns2:isMultiValue><ns2:value>Test</ns2:value></property></create></ns3:statements></ns3:update>

This just leads to a general exception so I simply don't know where to look for the bug(s).
Thanks in advance for any help provided…
6 REPLIES 6

vsuarez
Champ in-the-making
Champ in-the-making
I think you missed the childName element in the parent reference. This is necessary for creating the child node, and the value of this XML element must be normalized:


<parent>
  <ns2:store>
    <ns2:scheme>workspace</ns2:scheme>
    <ns2:address>SpacesStore</ns2:address>
  </ns2:store>
  <ns2:uuid>6d9ed674-982f-48c6-b2f3-b2d43fc185c8</ns2:uuid>
  <ns2:associationType>{http://www.alfresco.org/model/content/1.0}contains</ns2:associationType>
  <ns2:childName>{http://www.alfresco.org/model/content/1.0}Test</ns2:childName>
</parent>

gressho
Champ in-the-making
Champ in-the-making
Thanks for your answer. I still get the same type of Exception (an InvocationTargetException, Axis responds with Server.generalException). I hope the
parent element is correct now.
Do you have some example code?


<ns3:update xmlns="http://www.alfresco.org/ws/cml/1.0" xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0" xmlns:ns3="http://www.alfresco.org/ws/service/repository/1.0">
  <ns3:statements>
    <create>
      <id>create_1</id>
      <parent>
        <ns2:store>
          <ns2:scheme>workspace</ns2:scheme>
          <ns2:address>SpacesStore</ns2:address>
        </ns2:store>
        <ns2:uuid>6d9ed674-982f-48c6-b2f3-b2d43fc185c8</ns2:uuid>
        <ns2:associationType>{http://www.alfresco.org/model/content/1.0}contains</ns2:associationType>
        <ns2:childName>{http://www.alfresco.org/model/content/1.0}Test</ns2:childName>
      </parent>
      <type>text/xml</type>
      <property>
        <ns2:name>{http://www.alfresco.org/model/content/1.0}name</ns2:name>
        <ns2:isMultiValue>false</ns2:isMultiValue>
        <ns2:value>{http://www.alfresco.org/model/content/1.0}Test</ns2:value>
      </property>
      <property>
        <ns2:name>{http://www.alfresco.org/model/content/1.0}title</ns2:name>
        <ns2:isMultiValue>false</ns2:isMultiValue>
        <ns2:value>Test</ns2:value>
      </property>
      <property>
        <ns2:name>{http://www.alfresco.org/model/content/1.0}description</ns2:name>
        <ns2:isMultiValue>false</ns2:isMultiValue>
        <ns2:value>Test</ns2:value>
      </property>
    </create>
  </ns3:statements>
</ns3:update>

vsuarez
Champ in-the-making
Champ in-the-making
At this point we need to study the alfresco.log. This log file is located in the root of Alfresco installation. Could you paste here the trace of the exception raised on the server side?

gressho
Champ in-the-making
Champ in-the-making
Hello,

as I said, it's not very helpful.


08:08:36,264 DEBUG [org.apache.axis.encoding.DeserializationContext] Enter: DeserializationContext::endElement(http://www.alfresco.org/ws/service/repository/1.0, update)
08:08:36,264 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(popHandler00)
08:08:36,265 DEBUG [org.apache.axis.encoding.DeserializationContext] Popping handler org.apache.axis.message.RPCHandler@5cce7d
08:08:36,265 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(setProp00)
08:08:36,265 DEBUG [org.apache.axis.message.RPCHandler] Setting MessageContext property in RPCHandler.endElement().
08:08:36,265 DEBUG [org.apache.axis.encoding.DeserializationContext] Popped element stack to org.apache.axis.message.SOAPBody:Body
08:08:36,265 DEBUG [org.apache.axis.encoding.DeserializationContext] Exit: DeserializationContext::endElement()
08:08:36,265 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(value00)
08:08:36,265 DEBUG [org.apache.axis.providers.java.RPCProvider]   value:  org.alfresco.repo.webservice.types.CML@eb78db9b
08:08:36,270 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(toAxisFault00)
08:08:36,270 DEBUG [org.apache.axis.enterprise] Mapping Exception to AxisFault
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:710)
        at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:619)
Caused by:
        at org.alfresco.repo.webservice.repository.RepositoryWebService.update(RepositoryWebService.java:341)
        … 30 more
08:08:36,271 DEBUG [org.apache.axis.SOAPPart] Enter: SOAPPart ctor(FORM_FAULT)
08:08:36,271 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
08:08:36,271 DEBUG [org.apache.axis.SOAPPart] Setting current message form to: FORM_FAULT (currentMessage is now org.alfresco.repo.webservice.repository.RepositoryFault)
08:08:36,271 DEBUG [org.apache.axis.SOAPPart] Exit: SOAPPart ctor()
08:08:36,271 DEBUG [org.apache.axis.SimpleChain] Enter: SimpleChain::onFault
08:08:36,271 DEBUG [org.apache.axis.SimpleChain] Exit: SimpleChain::onFault
08:08:36,271 DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(axisFault00)
08:08:36,271 DEBUG [org.apache.axis.EXCEPTIONS] AxisFault:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
        {http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
        {http://xml.apache.org/axis/}stackTrace:
        at org.alfresco.repo.webservice.repository.RepositoryWebService.update(RepositoryWebService.java:341)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:710)
        at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:619)

        {http://xml.apache.org/axis/}hostname:ubsvirt16.uni-muenster.de


        at org.alfresco.repo.webservice.repository.RepositoryWebService.update(RepositoryWebService.java:341)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        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:710)
        at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Thread.java:619)

vsuarez
Champ in-the-making
Champ in-the-making
While I was studying your soap message and mine, I discovered that you are using the incorrect <type> value. <type> must be one of:
You are indicating the mime type instead.

gressho
Champ in-the-making
Champ in-the-making
Great, that did it. I also had to change the content (values) of the properties (there was an exception complaining about a constraint), now it works.
Thanks Smiley Tongue