<?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 A stand alone Java client for CMIS in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200669#M153799</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For all those who are struggling with it, here it goes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.axis.client.Call;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.axis.client.Service;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import javax.xml.namespace.QName;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import javax.xml.rpc.ParameterMode;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.axis.message.SOAPHeaderElement;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.axis.message.SOAPEnvelope;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.ws.security.message.token.UsernameToken;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.ws.security.WSConstants;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.ws.security.message.WSSecHeader;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.ws.security.util.WSSecurityUtil;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.w3c.dom.Document;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import org.apache.ws.security.message.token.Timestamp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class CMISTest {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public static void main(String [] args) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String endpoint = "&lt;/SPAN&gt;&lt;A href="http://localhost:8080/alfresco/cmis/RepositoryService" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/cmis/RepositoryService&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String repID = "33405a73-54c4-4fcf-92c5-2a7bb4a4568f";&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Service serv = new Service();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Call call = (Call) serv.createCall();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;call.setTargetEndpointAddress( new java.net.URL(endpoint) );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;call.setOperationName(new QName("&lt;/SPAN&gt;&lt;A href="http://www.cmis.org/2008/05" rel="nofollow noopener noreferrer"&gt;http://www.cmis.org/2008/05&lt;/A&gt;&lt;SPAN&gt;", "getRepositoryInfo"));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;call.addParameter( "id",new QName("&lt;/SPAN&gt;&lt;A href="http://www.w3.org/2001/XMLSchema%22,%22string" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema','string&lt;/A&gt;&lt;SPAN&gt;"),ParameterMode.IN);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;call.setReturnType(&amp;nbsp;&amp;nbsp;&amp;nbsp;new QName("&lt;/SPAN&gt;&lt;A href="http://www.w3.org/2001/XMLSchema%22,%22string" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema','string&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//call.setUsername("admin");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//call.setPassword("admin");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SOAPEnvelope se = new SOAPEnvelope(); // dummy envelope to create Header&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Document doc = se.getAsDocument();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;WSSecHeader secHeader = new WSSecHeader();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;secHeader.setMustUnderstand(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;secHeader.insertSecurityHeader(doc);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;UsernameToken username = new UsernameToken(Boolean.TRUE,doc,WSConstants.PASSWORD_DIGEST);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;username.setName("admin");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;username.setPassword("admin");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Timestamp ts = new Timestamp(true, doc,300);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;WSSecurityUtil.prependChildElement(doc, secHeader.getSecurityHeader(), username.getElement(), false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WSSecurityUtil.prependChildElement(doc, secHeader.getSecurityHeader(), ts.getElement(), false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SOAPHeaderElement she = new SOAPHeaderElement(secHeader.getSecurityHeader());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;call.addHeader(she);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String ret = call.invoke(new Object[] {repID}).toString();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.out.println(ret);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;} catch (Exception e) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e.printStackTrace();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Biswajit&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2008 07:52:36 GMT</pubDate>
    <dc:creator>biswajitbiswal</dc:creator>
    <dc:date>2008-11-12T07:52:36Z</dc:date>
    <item>
      <title>A stand alone Java client for CMIS</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200669#M153799</link>
      <description>Hi,For all those who are struggling with it, here it goes:import org.apache.axis.client.Call;import org.apache.axis.client.Service;import javax.xml.namespace.QName;import javax.xml.rpc.ParameterMode;import org.apache.axis.message.SOAPHeaderElement;import org.apache.axis.message.SOAPEnvelope;import o</description>
      <pubDate>Wed, 12 Nov 2008 07:52:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200669#M153799</guid>
      <dc:creator>biswajitbiswal</dc:creator>
      <dc:date>2008-11-12T07:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: A stand alone Java client for CMIS</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200670#M153800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Biswajit,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to CMIS. I installed Alfresco 3.2r2 and tried making CMIS webservices call but I am not able too. I used your code to make a start but it didn't help. Apart from URL (I replaced by server IP) what else I need to custmize to make the below code work for me? I want to use the getRepositories method of CMIS, how can I do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your code you have used repId, how can I get the repID from my Alfresco installation? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shivam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2009 07:21:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200670#M153800</guid>
      <dc:creator>shivam</dc:creator>
      <dc:date>2009-12-14T07:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: A stand alone Java client for CMIS</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200671#M153801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In your code you have used repId, how can I get the repID from my Alfresco installation?&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;curl -uadmin:admin "&lt;/SPAN&gt;&lt;A href="http://192.168.0.166:8080/alfresco/service/cmis" rel="nofollow noopener noreferrer"&gt;http://192.168.0.166:8080/alfresco/service/cmis&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and look for root collection or cmisra:repositoryInfo/cmis:rootFolderId&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2009 11:19:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/a-stand-alone-java-client-for-cmis/m-p/200671#M153801</guid>
      <dc:creator>rmorant</dc:creator>
      <dc:date>2009-12-31T11:19:50Z</dc:date>
    </item>
  </channel>
</rss>

