1 2 Previous Next 44 Replies Latest reply on Nov 15, 2008 5:20 PM by (rafael_quintana)

    SOAP and LiveCycle for dummies

      Hello,

      I am playing around AcroJS. I am using Latex to produce the PDF, not Acrobat! And I manage to do simple but nice things.
      /*I want just create an impressive CV/resumé */
      It is clear as water that trying to connect to a SOAP server turns out producing security exception in Reader.
      Is is clear as water that a server running LiveCycle ES is needed to avoid this security issue.

      Now some points are still obscure to me:
      * Is the server running LiveCycle needed in order to create a sort of special PDF which would 'bypass' reader security settings?
      * or Has this LiveCycle server, the same address as a SOAP server, so that when I try a SOAP connection, the PDF does before a 'LiveCycle' connection and based on the security infos obtained, the PDF can then access the SOAP services? And Does it means that If I find a SOAP server running LiveCycle I can access its services via Reader too?

      If this is the case does it exists a sort of demo server (I mean a running server and not some software) running Livecycle which offers SOAP services?

      In other words, can someone explains me how LiveCycle interacts with Reader and avoid security exceptions?
        • 1. Re: SOAP and LiveCycle for dummies
          Patrick Leckey Level 3
          You may be misunderstanding how the LiveCycle Server works.

          Any PDF, regardless of what application produced it and what type of server it is connecting to, will show the security message in Reader.

          What LiveCycle Server will do is produce a PDF at request time that's contents is based on form or other input data. As a very boiled-down metaphor, think of the PDF as a web page and LiveCycle Server as a web server running PHP or ASP doing dynamic content generation when the page is requested.

          Once the PDF is rendered it can be saved/copied/distributed just like any other PDF can but it is no longer dynamic - i.e. opening the PDF after you saved it to your desktop will not change the contents. You would have to go back to the LiveCycle Server and request another copy with different input and then the contents would be different.
          • 2. Re: SOAP and LiveCycle for dummies
            Level 1
            Thanks for the reply
            But bad news for me: no way to send via email a PDF containing a sort of demo of a SOAP connection, just to impress the person who may read my CV

            I mean, it would be feasible: But It would cost me too too too MUCH :)
            • 3. Re: SOAP and LiveCycle for dummies
              Patrick Leckey Level 3
              You could do it, but they would get a popup saying it is trying to connect to a remote server.

              Why not just include a button or link on your resume that controls the "SOAP demo" and informs them they will be prompted for a remote connection if they click it (perhaps by your own popup before the security warning)?
              • 4. Re: SOAP and LiveCycle for dummies
                Level 1
                Sorry PDL for late reply

                Well, this would be fine, if the demo would still be included in the PDF ...
                But I think I didn't get it ...
                does it means that if the command SOAP.connect is related to a button then Adobe Reader will allow me to connect? - right now I get a security exception in the debugger -
                Do you know a soap server who would do the trick? -even weather service would be great-
                • 5. Re: SOAP and LiveCycle for dummies
                  Patrick Leckey Level 3
                  If you look at the quick bar it shows that for SOAP.connect to work in Adobe Reader, the document requires Form Usage Rights. You would need to Reader-enable this form in Acrobat Professional (8.x only, not available in 7) or have access to a LiveCycle Reader Extensions server in order to grant these rights to a document. Then it will work in Reader.

                  As for web services to test with, use this site:
                  http://www.webservicex.net
                  • 6. Re: SOAP and LiveCycle for dummies
                    Level 1
                    Sorry again PDL,
                    but now I get confused: I have created my PDF. Then I have opened it with a trial version of Acrobat 8; I do have enabled usage rights, but when I try to connect to the 'webservicex' website I get the same results:

                    Here's my script(activate by a button on a form included at the document level):
                    SOAP.wireDump = true;
                    console.println("ok 1");
                    var cURL = "http://www.webservicex.net/globalweather.asmx?wsdl";
                    console.println("ok 2");
                    var myProxy = SOAP.connect(cURL);
                    console.println("ok 2");

                    And here's the debug console output from Reader:
                    ok 1
                    ok 2
                    Exception in line 163 of function myFirstJavaScriptFunction,
                    script 0
                    Exception in line 1 of function top_level, script 0
                    NotAllowedError: Security settings prevent access to this
                    property or method.
                    SOAP.connect:163:Page undefined:Open

                    So nothing new ... because in Reader I get no request to connect to a remote site (I do have one in Acrobat), despite having enabled form usage rights ...
                    • 7. Re: SOAP and LiveCycle for dummies
                      Bernd Alheit Adobe Community Professional & MVP
                      The document must have Form Export Rights. Look at the documentation. With the server product 'Adobe LiveCycle Reader Extensions ES' you can assign the rights.
                      • 8. Re: SOAP and LiveCycle for dummies
                        Level 1
                        Sorry Bernd,
                        but the point is that I wanted to set up a proof of concept form!
                        That means no investments: so no 'Adobe LiveCycle Reader Extensions ES' ...
                        I was looking for a way to do a demo ... just check previous posts to get an Idea of the situation.

                        Thank You for your comment
                        • 9. Re: SOAP and LiveCycle for dummies
                          Bernd Alheit Adobe Community Professional & MVP
                          Reader-enable the form in Acrobat 8 Professional isn't enough.
                          • 10. Re: SOAP and LiveCycle for dummies
                            Patrick Leckey Level 3
                            Yeah I misread the quick-bar. Bernd is correct.
                            • 11. Re: SOAP and LiveCycle for dummies
                              Level 1
                              So ... no way to do it ... in other words...
                              :(
                              • 12. Re: SOAP and LiveCycle for dummies
                                Patrick Leckey Level 3
                                Yes, with LiveCycle Reader Extensions Server. If that is not in your budget it won't work, but that is the way.

                                Shouldn't you be trying to impress employers with your wit and charm instead? :D
                                • 13. Re: SOAP and LiveCycle for dummies
                                  Level 1
                                  Hm? I connected to a server like this:

                                  var cURL = "http://localhost/test/webservice.asmx?WSDL";
                                  var service = Net.SOAP.connect(cURL);

                                  service.testMethod('halp');

                                  I noticed that I would get the error you mentioned if I added the js to the document programmatically, but if I placed the .js file in Adobe\Acrobat 8.0\Acrobat\Javascripts it would work.
                                  • 14. Re: SOAP and LiveCycle for dummies
                                    Patrick Leckey Level 3
                                    Yes, but he wanted to create an interactive resume. He can't really ask each person to whom he send his resume to add a javascript file to their Acrobat or Reader Javascripts directory.

                                    Folder-level JavaScript has to be on the client machine. You're also using Acrobat, not Reader. He was developing his form to work with Reader, which will require Form rights regardless of what folder-level JavaScripts you have.
                                    • 15. Re: SOAP and LiveCycle for dummies
                                      Level 1
                                      How does "LiveCycle ES" work exactly?

                                      I mean, if he installed that on the server, then the server would be able to add javascript to a pdf that:
                                      1) can make a SOAP call to a server
                                      2) can add a menu button to tell the pdf to make this SOAP call

                                      Is this possible with "LiveCycle ES" and nothing extra installed on the client or would you still need client javascript ?
                                      • 16. Re: SOAP and LiveCycle for dummies
                                        Patrick Leckey Level 3
                                        What do you mean by "client Javascript"? Do you mean folder-level JavaScript?

                                        "LiveCycle ES" is a suite of products, it is not a product itself. You'll need to be more specific. The product we are talking about here is LiveCycle Reader Extensions Server, which allows you to add additional rights to PDF files to open more functionality in Adobe Reader.

                                        As for 1 and 2, you can do that already, but it will only work if the client has Acrobat. If they only have Reader, you'll need LiveCycle Reader Extensions Server to extend the usage rights on the form.
                                        • 17. Re: SOAP and LiveCycle for dummies
                                          Level 1
                                          By "client javascript" I meant an existing javascript file on the client's computer. I would ideally like all javascript to be added to the document by the server, and then have the document sent to the client.
                                          • 18. Re: SOAP and LiveCycle for dummies
                                            Patrick Leckey Level 3
                                            There are some functions that require folder-level JavaScript regardless of what LiveCycle products you have due to security restrictions. Make sure you don't need to use any of these functions.

                                            All of a functions requirements are listed in the quickbar above the function in the API reference.
                                            • 19. Re: SOAP and LiveCycle for dummies
                                              Level 1
                                              Thanks PDL:)

                                              You mean the js_api_reference.pdf, which is 769 pages? I don't see a quickbar or any functions requirements.

                                              Looking through online_collaboration.pdf however, it does look like they assume that a custom javascript file will be installed on each client. I wonder if there's an easy way to install such a file.. like an activeX plugin would be installed.

                                              Having all clients find their acrobat javascript directory and place a .js file in there by hand is probably not an option ;)
                                              • 20. Re: SOAP and LiveCycle for dummies
                                                Patrick Leckey Level 3
                                                No, I've helped develop several collaboration workflows now that don't require folder-level JavaScript.

                                                There is a quickbar at the top of every function definition. Please see the following image:

                                                http://img88.imageshack.us/img88/1531/quickbarsxx4.png

                                                With js_api_reference.pdf open ...

                                                1) Open your bookmarks
                                                2) Expand the class containing the method you want
                                                3) Expand the methods section for that class
                                                4) Select the method you want
                                                5) The quickbar shows you all restrictions on that method

                                                To understand what the quickbar is telling you, see the section in the bookmarks under "Intruduction" titled "Quick bars".

                                                769 pages is not a lot for the API reference (the PDFL API Reference is just shy of 6000 pages). You don't need to memorize it, but how were you planning on doing Acrobat JavaScript development without knowing the API?
                                                • 21. Re: SOAP and LiveCycle for dummies
                                                  Level 1
                                                  Oh so that's what the quickbar is! Awesome, thanks:)

                                                  Yeah I just posted the page count to make sure we were looking at the same document because I didn't see anything that looked like a quickbar.
                                                  • 22. Re: SOAP and LiveCycle for dummies
                                                    Level 1
                                                    So let me see if I understand this..

                                                    Reader Enabling a pdf in Acrobat Pro does not grant the appropriate forms rights to use a web service in reader.

                                                    You can grant the forms rights with Livecycle ES.

                                                    You don't need folder-level js for a collaboration workflow. Do you need livecycle? Or can you just reader enable a pdf and use it for collaboration?

                                                    If I do the following in folder js it works, but if I have a function in folder js that does this, and I call that function from a menu button, it gives the not allowed error.

                                                    var result = Net.SOAP.connect('http://localhost/AM85/submit.asmx?WSDL');
                                                    app.alert("" + result);
                                                    • 23. Re: SOAP and LiveCycle for dummies
                                                      Patrick Leckey Level 3
                                                      You don't need folder-level js for a collaboration workflow. Do you need livecycle? Or can you just reader enable a pdf and use it for collaboration?

                                                      Depending on what changes you wish to make in your collborations, you may need LiveCycle. If you're simply adding markup annotations, Reader Enabling is fine. If you have multiple authors adding extended content, you may need LiveCycle RES.

                                                      > If I do the following in folder js it works, but if I have a function in folder js that does this, and I call that function from a menu button, it gives the not allowed error.

                                                      I'm not entirely sure I follow that statement. Could you elaborate?
                                                      • 24. Re: SOAP and LiveCycle for dummies
                                                        Level 1
                                                        The only changes I need to make are adding comments. I was hoping to have a "Synchronize" button that would run <br /><br />doc.syncAnnotScan();<br />var annots = doc.getAnnots();<br />var annotProps = new Array();<br />for(var i=0;i<annots.length;i++){<br />  annotProps[i] = annots[i].getProps();<br />}<br /><br />var strAnnots = JSON.stringify(annotProps); //convert objects to string<br /><br />var service = Net.SOAP.connect('http://localhost/AM85/submit.asmx?WSDL');<br /><br />var result = service.SaveAnnotations({annots: strAnnots});<br /><br />It's the Net.SOAP.connect function that's giving me trouble. If I place it in a folder-level javascript file it will work.<br /><br />If I place it in document level javascript it will give a not allowed error.<br /><br />If I place it in a trusted function and call it from a menu item, it will give a not allowed error. <br /><br />So I'm not sure how to call a webservice without having livecycle
                                                        • 25. Re: SOAP and LiveCycle for dummies
                                                          Patrick Leckey Level 3
                                                          No, as the documentation says the SOAP.connect method requires rights that can only be granted from LiveCycle RES.

                                                          You have more options than using SOAP though, such as using submitForm with the POST action and having your webservice do all the processing past that. Much more complicated to code and less intuitive, but that's the trade-off for not wanting to buy the products that are designed to make it easier.

                                                          You also realize that while you can Reader Enable the form from Acrobat, per the EULA this is only a "demonstration feature" and that once you have collected 500 responses to your form (basically, after the "Synchronize" button has been clicked a cumulative total of 500 times by anyone anywhere) you would be in violation of the licensing agreement.
                                                          • 26. Re: SOAP and LiveCycle for dummies
                                                            Level 1
                                                            Hm. Okay, so let's suppose we only use LiveCycle to grant usage rights to a pdf. Then we upload this pdf to a server and let users create annotations through another interface.

                                                            The users can then choose to download the pdf, at which time we would take the LiveCycle enabled pdf and perform an incremental update on it to add the annotations.

                                                            Would this incremental update affect the signature from LiveCycle?
                                                            • 27. Re: SOAP and LiveCycle for dummies
                                                              Patrick Leckey Level 3
                                                              You're talking about several different LiveCycle products there. Which mix of products are you planning on using, since several different configurations of LiveCycle products could work for the broad description you've given.

                                                              >and let users create annotations through another interface

                                                              What type of interface?

                                                              > The users can then choose to download the pdf

                                                              The PDF has to be downloaded for them to view it or edit it.
                                                              • 28. Re: SOAP and LiveCycle for dummies
                                                                Level 1
                                                                Sorry for the confusion, I'll try to phrase the use case better:

                                                                Suppose I have a pdf and I enable all rights using LiveCycle RES.

                                                                Then I have a program that performs an incremental update on this pdf. (The only changes the incremental update makes are to add comments/annotations)

                                                                Then I open up the pdf in Reader. Are the rights preserved?
                                                                • 29. Re: SOAP and LiveCycle for dummies
                                                                  Level 1
                                                                  So after testing this a few times, it works sometimes, and sometimes not.

                                                                  If the incremental update just adds annotations, then the rights are preserved.

                                                                  However, if the incremental update also adds javascript which requires the document catalog object to be changed, (A /Names entry is added to the document catalog's dictionary) then the rights are not preserved.

                                                                  So then I have a new question:

                                                                  Is there any way to add javascript to a pdf without changing the document catalog?
                                                                  • 30. Re: SOAP and LiveCycle for dummies
                                                                    Level 1
                                                                    Oh! Could LiveCycle RES just do that? Like, could LiveCycle add a /Names entry into the document catalog and then enable the pdf?
                                                                    • 31. Re: SOAP and LiveCycle for dummies
                                                                      Patrick Leckey Level 3
                                                                      > Like, could LiveCycle add a /Names entry into the document catalog and then enable the pdf?

                                                                      RES couldn't. You would need LiveCycle PDF Generator for that, maybe LiveCycle Forms.

                                                                      > Is there any way to add javascript to a pdf without changing the document catalog?

                                                                      Not if you need it embedded in the document. If it's a one-time use you can use an FDF and an Open action.
                                                                      • 32. Re: SOAP and LiveCycle for dummies
                                                                        Level 1
                                                                        PDL, could you elaborate more on the idea of using

                                                                        "...submitForm with the POST action..."

                                                                        to get around the security issue that reader has? I am trying to access a webservie via reader and I ran into the same problem as Bruno...
                                                                        • 33. Re: SOAP and LiveCycle for dummies
                                                                          Patrick Leckey Level 3
                                                                          > to get around the security issue that reader has?

                                                                          First, it's not an issue. It was designed that way. You have to work around it when using a free product instead of paying for the licensed version, which has no such restriction.

                                                                          > "...submitForm with the POST action..."

                                                                          You can submit XML data from Reader without extending the form. If you read the documentation on the submitForm method, you can set the bGet parameter to false so that it will post the XML data to your webservice. It won't be in a SOAP envelope, but you can still send the data without any extending. It's all covered in the documentation, just read the section on submitForm.
                                                                          • 34. Re: SOAP and LiveCycle for dummies
                                                                            Level 1
                                                                            Thanks PDL. When I think about it, my form actaully does more importing data than it does exporting. Is there any way to import data from a webservice?
                                                                            • 35. Re: SOAP and LiveCycle for dummies
                                                                              Level 1
                                                                              in Acrobat Reader that is...
                                                                              • 36. Re: SOAP and LiveCycle for dummies
                                                                                Patrick Leckey Level 3
                                                                                Yes, but not with the submitForm method. The form would have to be Reader Extended to import data.
                                                                                • 37. Re: SOAP and LiveCycle for dummies
                                                                                  Level 1
                                                                                  I tried to import data via a webservice in acrobat reader 9 and it didn't work. I reader extended the form using professional 8. Is there another way to import data into reader?
                                                                                  • 38. Re: SOAP and LiveCycle for dummies
                                                                                    Patrick Leckey Level 3
                                                                                    > and it didn't work.

                                                                                    Could you maybe be a little more specific?

                                                                                    > I reader extended the form using professional 8.

                                                                                    Acrobat 8 can't Reader Extend the form. It enables usage rights. You need Reader Extensions Server to Reader Extend a form, it will allow for a lot more functionality than enable usage rights in Acrobat, including "Form Usage Rights", which Acrobat cannot grant and SOAP needs (note the "F" in the quickbar). "Form Usage Rights" can only be granted by a LiveCycle Reader Extensions Server.
                                                                                    • 39. Re: SOAP and LiveCycle for dummies
                                                                                      Level 1
                                                                                      Our organization is trying to go for a solution that doesn't require anything beyond Acrobat Professional 7 & 8. It seems we'll have to come up wtih another way to get the job done. Thanks, PDL, for clearing that up for me.
                                                                                      1 2 Previous Next