<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Rest Api Error '&amp;quot;cm:content&amp;quot; isn't a valid QName. Namespace' while uploading a file wi in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108239#M30427</link>
    <description>&lt;P&gt;Try comparing the documentation here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-mng-folders-files.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-mng-folders-files.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It works fine on 5.2.x and 6.x just fine via POSTMAN and CURL.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 16:33:11 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2020-11-13T16:33:11Z</dc:date>
    <item>
      <title>Rest Api Error '"cm:content" isn't a valid QName. Namespace' while uploading a file with a post</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108238#M30426</link>
      <description>&lt;P&gt;So i'have a Alfresco Community server (5.2.X and 6.2.X), i have prepared a retrofit2 client for communicate with the rest api of Alfresco, &lt;STRONG&gt;it's work just fine with all the services&lt;/STRONG&gt;, but there is some strange error when i try to upload a file with the "createNode" post method of the rest api with contentype "multipart/form-data".&lt;/P&gt;&lt;P&gt;Here the retrofit 2 code for upload a file with the rest api:&lt;/P&gt;&lt;PRE&gt;@Multipart
@POST("nodes/{nodeId}/children")
Call&amp;lt;NodeEntry&amp;gt; createNodeCall(
	@retrofit2.http.Path("nodeId") String nodeId,
	//@retrofit2.http.Body NodeBodyCreate nodeBodyCreate, //Removed because is the multipart/form-data	    
	@retrofit2.http.Query("autoRename") Boolean autoRename,
	@retrofit2.http.Query("include") CSVParams include,
	@retrofit2.http.Query("fields") CSVParams fields,
	@retrofit2.http.PartMap() Map&amp;lt;String, RequestBody&amp;gt; partMap, //Added because is the multipart/form-data 
	@retrofit2.http.Part MultipartBody.Part filedata //Added because is the multipart/form-data	
);&lt;/PRE&gt;&lt;P&gt;Here the content of the "partMap" map:&lt;/P&gt;&lt;PRE&gt;"name" = "ifc-32.png"
"nodeType" = "cm:content"
"relativePath" = null
"association" = null
"secondaryChildren" = null
"targets" = null
other properties with key-value relationship but in this case there are no ones...&lt;/PRE&gt;&lt;P&gt;The strange thing is i doesn't get a 404 or 401 or some other common issue, but instead Alfresco tell me this strange error:&lt;/P&gt;&lt;PRE&gt;{
    "error":{
        "errorKey":""cm:content" isn't a valid QName. Namespace prefix "cm is not mapped to a namespace URI",
        "statusCode":400,
        "briefSummary":"10130018 "cm:content" isn't a valid QName. Namespace prefix "cm is not mapped to a namespace URI",
        "stackTrace":"Per motivi di sicurezza l'analisi dello stack non viene più visualizzata, ma viene mantenuta la proprietà per le versioni precedenti",
        "descriptionURL":"https://api-explorer.alfresco.com"
    }
}&lt;/PRE&gt;&lt;P&gt;What that is mean??? "cm:content" is the de facto standard type of documents... i don't understand...&lt;/P&gt;&lt;P&gt;The default value is still "cm:content" so i just set :&lt;/P&gt;&lt;PRE&gt;"nodeType" = null&lt;/PRE&gt;&lt;P&gt;and try again.&lt;/P&gt;&lt;P&gt;After that a similar error is showed up for the "name" parameter. Here the error i get after send the nodetype and name with null value:&lt;/P&gt;&lt;PRE&gt;{
    "error":{
        "errorKey":"framework.exception.ApiDefault",
        "statusCode":422,
        "briefSummary":"10130069 Found 1 integrity violations: Invalid property value: Node: workspace://SpacesStore/ed95ec75-0240-40ed-8f36-c7ad19cd3262 Name: "ifc-32.png" Type: {http://www.alfresco.org/model/content/1.0}content Property: {http://www.alfresco.org/model/content/1.0}name Constraint: 10130068 Value '"ifc-32.png"' is not valid as a file name. This property must be a valid file name.",
        "stackTrace":"Per motivi di sicurezza l'analisi dello stack non viene più visualizzata, ma viene mantenuta la proprietà per le versioni precedenti",
        "descriptionURL":"https://api-explorer.alfresco.com"
    }
}&lt;/PRE&gt;&lt;P&gt;So i removed the name parameter :&lt;/P&gt;&lt;PRE&gt;"name" = null&lt;/PRE&gt;&lt;P&gt;and now it's finally work why ???&lt;/P&gt;&lt;DIV class="C B"&gt;&lt;DIV class="w D"&gt;&lt;DIV class="P"&gt;&lt;SPAN class="object"&gt;&lt;SPAN class="toggle-end"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Nov 2020 15:39:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108238#M30426</guid>
      <dc:creator>AlfrescoZZZ</dc:creator>
      <dc:date>2020-11-13T15:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rest Api Error '"cm:content" isn't a valid QName. Namespace' while uploading a file wi</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108239#M30427</link>
      <description>&lt;P&gt;Try comparing the documentation here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-mng-folders-files.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-mng-folders-files.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/dev-api-by-language-alf-rest-upload-file.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It works fine on 5.2.x and 6.x just fine via POSTMAN and CURL.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 16:33:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108239#M30427</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-11-13T16:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rest Api Error '"cm:content" isn't a valid QName. Namespace' while uploading a file wi</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108240#M30428</link>
      <description>&lt;P&gt;The error was strange but it's seems not present on Alfresco 6 so my soltuion is if you encounter this problem update Alfresco 5 to Alfresco 6&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 09:43:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/rest-api-error-quot-cm-content-quot-isn-t-a-valid-qname/m-p/108240#M30428</guid>
      <dc:creator>AlfrescoZZZ</dc:creator>
      <dc:date>2020-12-16T09:43:06Z</dc:date>
    </item>
  </channel>
</rss>

