Hi David,
This doesn't work, the output is "binary" and the "Text/Text to Binary" template has an encoding after which the output is corrupted. Below a more detailled description of what we are doing.
Tersus client to REST Document service
Because we expierenced too many problems with generating documents to DOC/DOCX in the standard Convert Document-template we have internally developed an REST Service to generate msWord/PDF documents (with Aspose). To generate an document a request is made to the REST Service in which an XML file is POSTED to the service. This XML document contains all (meta)data needed to generate the document. This XML document is posted to the service with Content-type 'application/xml'
On receive the service interprets the XML document and generates an msWord/PDF documents. This document is send back to the calling client within the same request. The service sends the generated document as an response back to the client.
In this response header the content-type set to application/octet-stream or to the mediatype related to the document type (docx, application/vnd.openxmlformats-officedocument.wordprocessingml.document). In the response a Content-disposition header is added. This to set the filename of the document and to offer the document as a seperate attachment to the client.
In our setup an Tersus application will act as a client to the service. Therefore Tersus must be able to make HTTP POST request with no restriction on request/ response content-type. In the current setup Tersus always expects an String (application/text, application/xml ?) back
INFO: Inbound Message
----------------------------
ID: 1
Address: /documentservice/generate
Encoding: ISO-8859-1
Content-Type: application/xml
Headers: {content-type=[application/xml], Host=[tbg11077:9000], Content-Length=[3743], User-Agent=[ApacheBench/1.3d], Content-Type=[application/xml], Accept=[*/*]}
Payload: <?xml version="1.0" encoding="UTF-8"?>
. . . . . . . . . . . . . . . . . . . . . .
--------------------------------------
11-feb-2010 9:41:54 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
INFO: Outbound Message
---------------------------
ID: 2
Encoding:
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Headers: {Content-Type=[application/vnd.openxmlformats-officedocument.wordprocessingml.document], Content-Disposition=[attachment; filename=document.docx], Date=[Thu, 11 Feb 2010 08:41:54 GMT]}
Payload:. . . . . . . . . . . . . . . . . . . . . .
To solve our problem with HTTP Post the <response> trigger should be of the type "Anything".
As a work around we use now the External Command (with it's own problems)
JPwww.giessenict.nl
To use the full functionality of this web site, JavaScript needs to be turned on.
For best results, use the Firefox browser..
Copyright © 2003-2017 - Tersus Software Ltd., All rights reserved. Terms of Use License Graphic design by EmaraDesign