cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to use content-service.wsdl

slax
Champ in-the-making
Champ in-the-making
Hello all,

I am trying to use content-service.wsdl to read and write content in Alfresco using the webservice API. I got all the authentication process and security understood, but now I keep getting the following error :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server.generalException</faultcode>
         <faultstring/>
         <detail>
            <ns1:ContentFault xmlns:ns1="http://www.alfresco.org/ws/service/content/1.0">
               <ns1:errorCode>0</ns1:errorCode>
               <ns1:message>Argument qname is mandatory</ns1:message>
            </ns1:ContentFault>
            <ns2:exceptionName xmlns:ns2="http://xml.apache.org/axis/">org.alfresco.repo.webservice.content.ContentFault</ns2:exceptionName>
            <ns3:stackTrace xmlns:ns3="http://xml.apache.org/axis/">at org.alfresco.repo.webservice.content.ContentWebService.read(ContentWebService.java:106)
   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)
       […]
   </ns3:stackTrace>
            <ns4:hostname xmlns:ns4="http://xml.apache.org/axis/">PIERRE-INTALIO</ns4:hostname>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

This is when trying to use the "read" operation with the following message :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alfresco.org/ws/service/content/1.0" xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
   <soapenv:Header>
      <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <Timestamp xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ans1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <ans1:Created>2008-10-23T10:23:28-08:00</ans1:Created>
            <ans1:Expires>2008-12-30T22:25:28-08:00</ans1:Expires>
         </Timestamp>
         <UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <Username>admin</Username>
            <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_63e6b6f00d3ee0a4e3f5f4282d9dd61d1a48c792</Password>
         </UsernameToken>
      </Security>
</soapenv:Header>
   <soapenv:Body>
      <ns:read>
         <ns:items>
            <ns1:nodes>
               <ns1:store>
                  <ns1:scheme>workspace</ns1:scheme>
                  <ns1:address>SpacesStore</ns1:address>
               </ns1:store>
               <ns1:uuid>92edbb56-b768-48d3-b786-2be4d7de281b</ns1:uuid>
            </ns1:nodes>
         </ns:items>
      </ns:read>
   </soapenv:Body>
</soapenv:Envelope>

Does anybody knows what I'm doing wrong ? What does "Argument qname is mandatory" mean ? Which argument is it talking about ? Many thanks in advance.
4 REPLIES 4

slax
Champ in-the-making
Champ in-the-making
Update :

I haven&#39;t understood yet (I&#39;d still like an answer, if anyone has it), but I managed to work around it. All I needed to do was put something in the "property" element (anything, any string, even one blank space works)&#8230;

Can anybody explain this ? The reponse message is this :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <readResponse xmlns="http://www.alfresco.org/ws/service/content/1.0">
         <content>
            <node>
               <ns1:store xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
                  <ns1:scheme>workspace</ns1:scheme>
                  <ns1:address>SpacesStore</ns1:address>
               </ns1:store>
               <ns2:uuid xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0">92edbb56-b768-48d3-b786-2be4d7de281b</ns2:uuid>
               <ns3:path xmlns:ns3="http://www.alfresco.org/ws/model/content/1.0">/app:company_home/app:user_homes/cm:PierreTest/cm:MyNewTextFile</ns3:path>
            </node>
            <property></property>
            <length>0</length>
            <format xsi:nil="true"/>
            <url xsi:nil="true"/>
         </content>
      </readResponse>
   </soapenv:Body>
</soapenv:Envelope>

vsuarez
Champ in-the-making
Champ in-the-making
You need to declare the type of node you are retrieving:


<S:Body>
   <ns2:read xmlns:ns2="http://www.alfresco.org/ws/service/content/1.0" xmlns="http://www.alfresco.org/ws/model/content/1.0">
      <ns2:items>
         <nodes>
            <store>
               <scheme>workspace</scheme>
               <address>SpacesStore</address>
            </store>
            <uuid>9b728599-a0ed-11dd-b25e-77b9100b65ec</uuid>
         </nodes>
      </ns2:items>
      <ns2:property>{http://www.alfresco.org/model/content/1.0}content</ns2:property>
   </ns2:read>
</S:Body>

slax
Champ in-the-making
Champ in-the-making
Thank you very much ! That answers my first question as well  Smiley Very Happy

vsuarez
Champ in-the-making
Champ in-the-making
Thank you very much ! That answers my first question as well  Smiley Very Happy

Happy if it helped  Smiley Happy
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.