To insert a document in alfresco document management service, insure a store exists and a user has rights to it, following that follow steps below
1) Use authentication service to Authenticate and retrieve a token
2) Use the token from step 1 and pass to any subsequent web service calls, in this case create service (to store document)
Alfresco Authentication service from ESB
Insure alfresco is running, if not start alfresco using shortcut in start menu
1) Import the WSDL. The WSDL file could be found in WSDL folder example C:\Alfresco\tomcat\webapps\alfresco\wsdl
2) Create business service using the business service in step 1
3) Call the start session operation, passing the username and password.
This will result in service returning:
TICKET_d1b09a6cf0a6083e1079be6dff9a09ff1300fd95
Ticket returned in the response needs to be passed along to subsequent calls in SOAP header
Content service in alfresco
When calling write operation in create service, authentication information is required in soap header example:
SpacesStore
Content
The content passed in write operation needs to be in base64 format. There are various methods of encoding a file into base64 format. To get started one could use online services. Programmatically ESB provides function to convert text to base64 format. In POC it was converted using JAX-WS based web service.
Mime type
Correct mime type of the content needs to be passed along so that when reading browser could render the content. List of mime types could be found here
Password Text
Password text field contains the Ticket retrieved from authentication service.
Once the document has been uploaded into the repository end session operation of authentication service is called along with ticket
Copy the DLL for CIFS to work
From
C:\Alfresco\extras\bin
To
C:\WINDOWS\system32
2 comments:
Interesting example. We are integrating Alfresco with ServiceMix ESB. What use case do you have in mind? We have a lot of automated content processing to support our web site, and are attempting to offload acquisition, transformation (incl. translation) and publishing to ESB.
Thanks Ed,
Alfresco is used as repository to store documents in xml format.
Post processing is applied to xml to archive in appropriate location, apply appropriate template to convert them to pdf/word on the fly.
the role of esb is to provide a layer of abstraction so the client is unaware where documents are being stored
Post a Comment