Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Paul,
I am working on the form that is similar to this post and have a problem as well. You have mention: "to have the images returned as base64 encoded images inside of a web service call" Do you have an sample on how to have it done, can you please share. Or can you please explain little bit more on how to start it.
Thanks,
Han Dao
Views
Replies
Total Likes
I am assuming that you are using LC Server to construct the Web Service call. I simply retieve the image from the file system or repository (depending on where you stored it) and either of those services creates a document object. Then in a setValue operation you can assign the document object to a string variable that is marked as output. In that assignment you can use the Document functions that are provided and one of them converts the doc to a Base64 encoded string.
Thats all there is to it.
Paul
Views
Replies
Total Likes
Hi Paul,
Thanks for the reply. I think I am still confusing here. Do you have an example that you can share? I am still using LC ES with SP3.
Han Dao
Views
Replies
Total Likes
I have one but it is for ES2 SP1. I do not think you will be able to import it. I will write out step by step instructions but I cannot get to it until tomorrow.
Paul
Views
Replies
Total Likes
Thanks Paul. I appreciate your help on writing the step by step instruction that you will provide. I think it would others as well.
Thanks again,
Han Dao
Views
Replies
Total Likes
In the version that you have you only have one choice to interface with LC (SOAP). In ES2 you coudl also use the Rest Interface (start the orchestration with a URL in the image field but that is a topic for another day).
So in using Soap we must Reader extend the form to allow Reader users to make Soap calls or if we are only interested in getting the image when the form renders then we can set the retrieve image soap call to run server side and no Reader Extensions are required. I will assume an interactive form for now.
To build the Soap service we need two things. A service to retrieve the image from whatever location it is in and a setValue service to base64 encode the contents of the image (for transporation on the Soap envelope). So here is what you need to do:
1. Create a new orchestration - it shoudl be shortlived.
2. Add the service that yo need to retrieve the contents of the image - a readDocument (if on the filesystem) or a retrieve content service (if image is in repository).
3. Create a document variable to hold the image.
4. Configure the service to read the image and store it in the new doc var. Note that you may want to create some sort of input parameter to be able to control which image is retrieved by passing in its value.
5. Drag a new SetValue operation on to the orchestration and connect the read operation to the setValue.
6. Create a new variable of type string (unlimited length) and set it as an output. This is what will be returned to the form and will contain the base64 encoded image.
7. In the setValue create a new Mapping.
8. Edit the mapping to have the string variable in the Location.
9. In the Expression side click to Edit the Expression.
10. In the Editor click on the Functions tab and choose the Document Object Functions. A list of Document Object Functions will appear.
11. Double click on the getDocContentBase64(com.adobe.idp.Document) function. It will be placed in the editor.
12. Renove the com.adobe.idp.Document from inbetween the braces and replace it with the Doc var that holds the image contents. You can click on the Process Data tab and simply choose it from the list. It will be placed in the expression where the cursor currently resides.
13. Now you can save and test you orchestration. Try it from inside of workbench and ensure that it is working as we designed it. You will get a screen of jumbled chars if it works as this is the string that is the base64 encoded image being returned to you.
You may want to turn security off for this service as you do not want to have the user enter credentials each time they get an image.
Now in Designer....
1. Create a new DataConnection of type WSDL
2. Point to the WSDL that was just created.
3. Bind the output string to the ImageField - you may also need to bind any inputs that you have setup.
4. You need a way of executing the SOAP connection - you can use the button provided or you can programmatically execute the service by using:
xfa.connectionSet.DataConnectionName.execute()
You can also put the button provided on the form and prgrammatically click it as well.
Now when you execute the web service the orchestration will run - retrieve the image, base64 encode it and return it to the form. The binding will stream the image contents into the image field and it will display.
Paul
Views
Replies
Total Likes
Hi Paul,
Thanks for the valueable instructions. I try to configure the service to read the image based on the input that the user enter but get confused. Can you please explain a little bit more on how to "Note that you may want to create some sort of input parameter to be able to control which image is retrieved by passing in its value."
Many Thanks.
Han Dao
Views
Replies
Total Likes
I woudl start by hardcoding the image name in the service to verify that it works. Once that is done, you need some way of telling the service which image you want. This is usually done by passing in the image name. If all images are an employee number followed by an extension, then you can pass the employee number (the dynamic part of the file name) and construct the rest of the filename (the static part) using a setValue operation and string functions.
Paul
Views
Replies
Total Likes
Hi Paul,
I tried as you suggested but got the below error:
"[8/13/10 10:26:24:436 CDT] 00000042 WorkflowDSCIn E com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker logFailedFaultRouting An exception was thrown with name com.adobe.livecycle.fileutils.FileUtilsException message:ALC-FUT-001-011: File "http://msms/images/catalog/200.jpg" does not exist. while invoking service FileUtilsService and operation readDocument and no fault routes were found to be configured."
Can you help on this, please provide your email if you would like to see my process.
Thanks,
Han Dao
Views
Replies
Total Likes
If you are using the read from file system then you cannot pass in a URL ...it is expecting a file reference.
paul
Views
Replies
Total Likes
Paul,
Well even I tried the UNC path like in Windows explorer, I still got the same error. Please see the error below.
[8/13/10 13:12:58:467 CDT] 00000026 WorkflowDSCIn E com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker logFailedFaultRouting An exception was thrown with name com.adobe.livecycle.fileutils.FileUtilsException message:ALC-FUT-001-011: File D:\My Pictures\Smile.jpg does not exist. while invoking service FileUtilsService and operation readDocument and no fault routes were found to be configured.
Is there a way to make it work with the URL link ?
Thanks,
Han Dao
Views
Replies
Total Likes
Stupid question but is the file smile.jpg in that location - on the server where the process is running?
Paul
Views
Replies
Total Likes
Well, it was not on the same server. So I moved the file to the server where the LC Process is located then the error is gone.
So here are my two questions:
1) If the file is on a different server, how can I make it work? Does it work with the UNC path like \\ComputerName\SharedFolder\Resource\ ?
2) Is it possbile to make it work with URL link like "http\\abc.com\image\filename.jpg" ?
Thanks,
Han Dao
Views
Replies
Total Likes
Then you will need a service to get the file from the other server. If you map a drive to the other server you could use the File Read that you are using. There are other services that come with teh product (FTP, SOAP) that you coudl use to retrieve it.
Paul
Views
Replies
Total Likes
Hi Paul,
I was busy with other forms that was more priority and haven't time to continue on this form until now. So far, I have it work fine by hard coding the path for the image in the web service, now I am getting stuck or confuse in making it to use the dynamic value to show the image. e.g. user enter the value like "200" in the form, click on the WS button, it will then concat the UNC path along with image extention .jpg to display on the form like this (\\server name\imageCatalog\smile.jpg) . Can you please advise.
Thanks,
Han Dao
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies