AnsweredAssumed Answered

Exception while adding aspect: InvalidQNameException: Argument qname is mandatory

Question asked by nick.l on Apr 5, 2013
Latest reply on Apr 8, 2013 by nick.l
My code is like below:

——————
        Reference ref = new Reference(STORE, folder.getId(), folder.getPath());
        String uuid = ref.getUuid();
       
        ParentReference parentReference = new ParentReference(store, uuid, null, Constants.ASSOC_CONTAINS, "{" + Constants.NAMESPACE_CONTENT_MODEL + "}" + name);
                
        
        NamedValue[] prop = new NamedValue[]{Utils.createNamedValue(Constants.PROP_NAME, name)};
        CMLCreate create = new CMLCreate("1", null, uuid,  Constants.ASSOC_CONTAINS, null, Constants.PROP_CONTENT, prop);

        CML cml = new CML();
        cml.setCreate(new CMLCreate[]{create});
       
        NamedValue author = Utils.createNamedValue(
                Constants.createQNameString(MY_NS, "author"), "tom");
        NamedValue desc = Utils.createNamedValue(
                Constants.createQNameString(MY_NS, "description"), "desc Ok");
        NamedValue internal = Utils.createNamedValue(
                Constants.createQNameString(MY_NS, "internal"), "yes");
        NamedValue[] ascProperties = new NamedValue[]{author, desc, internal};
        CMLAddAspect addaspect = new CMLAddAspect();
        addaspect.setAspect(Constants.createQNameString(MY_NS, "DocDetails"));
        addaspect.setProperty(ascProperties);
        addaspect.setWhere_id("1");
        cml.setAddAspect(new CMLAddAspect[]{addaspect});
        WebServiceFactory.getRepositoryService().update(cml);
———————–
But I got org.alfresco.service.namespace.InvalidQNameException: Argument qname is mandatory

[sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39), sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27), java.lang.reflect.Constructor.newInstance(Constructor.java:513), java.lang.Class.newInstance0(Class.java:355), java.lang.Class.newInstance(Class.java:308), org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104), org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90), org.alfresco.webservice.repository.RepositoryFault.getDeserializer(RepositoryFault.java:146), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154), org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84), org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464), org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547), org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157), org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035), com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501), com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400), com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755), com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648), com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140), com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511), com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808), com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737), com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119), com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205), com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522), javax.xml.parsers.SAXParser.parse(SAXParser.java:395), org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227), org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696), org.apache.axis.Message.getSOAPEnvelope(Message.java:435), org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62), org.apache.axis.client.AxisClient.invoke(AxisClient.java:206), org.apache.axis.client.Call.invokeEngine(Call.java:2784), org.apache.axis.client.Call.invoke(Call.java:2767), org.apache.axis.client.Call.invoke(Call.java:2443), org.apache.axis.client.Call.invoke(Call.java:2366), org.apache.axis.client.Call.invoke(Call.java:1812), org.alfresco.webservice.repository.RepositoryServiceSoapBindingStub.update(RepositoryServiceSoapBindingStub.java:986),

Outcomes