15 Replies Latest reply on Jan 10, 2008 12:57 PM by Hodmi

    GeneratePDFService quick start code issue

      Hi,

      I am getting a build error, while using quick start code for converting the native document into PDF document through webservice api.

      error: The type or namespace TestPDFG8WS couldn't found

      In the quickstart code, it is using TestPDFG8WS as namespace as you can see below a line of code.
      using TestPDFG8WS.GeneratePDFService;

      Any idea, what reference we have to add to fix the issue ?.

      refer the following link to see the quickstarts code .
      http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/wwhelp/wwhimpl/common/ht ml/wwhelp.htm?context=sdkHelp&file=quickStarts_GeneratePDF.11.1.html

      Regards,
      Arvind
        • 1. Re: GeneratePDFService quick start code issue
          Jasmin Charbonneau Level 4
          I believe this is the name of the .Net Web Reference and the proxy class that was created when adding the Web Reference.

          You can name it what ever you want when you create the Web Reference.

          Jasmin
          • 2. Re: GeneratePDFService quick start code issue
            Level 1
            Jasmin,

            Thanks for the quick response !.

            But I think it is not mentioned about creating Web Reference in the SDK_help document for Converting from native file format to PDF using the web service API (see summary steps)

            So could you please let me know how to do that.

            Regards,
            Arvind
            • 3. Re: GeneratePDFService quick start code issue
              Jasmin Charbonneau Level 4
              It's always the same procedure. Look in the help under

              Invoking LiveCycle ES Using Web Services
              and then under Creating a .NET client assembly.

              You just need to point to a different wsdl, but the idea is the same.

              Jasmin
              • 4. Re: GeneratePDFService quick start code issue
                Level 1
                Jasmin,
                Yes, now I am able to add Web Reference. But now I am getting compile error as follow.

                error: The type or namespace GeneratePDFServiceServiceWse couldn't found.

                I looked the quick start code and I found that it is creating a GeneratePDFServiceServiceWse object since DIME attachments are used.

                But in the WebReference of GeneratePDFService, only GeneratePDFServiceService class is there but not GeneratePDFServiceServiceWse.

                So could you please let me know how to fix the above problem.

                Thanks,
                Arvind
                • 5. Re: GeneratePDFService quick start code issue
                  Hodmi Level 4
                  Hi Arvind;

                  I'll admit that I'm not a .net expert, but I was under the impression that Microsoft abandoned the DIME attachment format with .Net 2.0.

                  I have been able to use a base64 encoded message with success.

                  In the following code my web reference is called: GeneratePDFServiceService

                  private void goButton_Click(object sender, EventArgs e)
                  {
                  // Create a GeneratePDFServiceServiceWse service object

                  GeneratePDFServiceService svc = new GeneratePDFServiceService();
                  svc.Url += "?blob=base64"; //Visual Studio 2005 (WSE 3.0) does not support DIME and MIME attachments

                  //set the login credentials
                  svc.Credentials = new System.Net.NetworkCredential("administrator","password");

                  // Create a BLOB that represents the input Microsoft Word file
                  BLOB inDoc = new BLOB();

                  String inFileName = "C:/temp/myDoc.doc";

                  inDoc.binaryData = this.readFile(inFileName);

                  // Specify the PDF and security settings
                  String adobePDFSettings = "Standard";
                  String securitySettings = "No Security";
                  String fileTypeSettings = "Standard";

                  mapItem[] createPDFResults = svc.CreatePDF(inDoc,
                  inFileName,
                  fileTypeSettings,
                  adobePDFSettings,
                  securitySettings,
                  null,
                  null
                  );



                  // Obtain the converted document and log file identifiers
                  for (int count = 0; count < createPDFResults.Length; ++count)
                  {

                  //get an item from the map
                  mapItem mapEntry = createPDFResults[count];
                  String mapKey = mapEntry.key as String;

                  //The new PDF will always have the map key "ConvertedDoc"
                  if (mapKey.Equals("ConvertedDoc")){
                  String filename = "C:/temp/" + mapKey + ".pdf";

                  BLOB resultBlob = mapEntry.value as BLOB;
                  byte[] binaryFile = resultBlob.binaryData;
                  this.writeFile(filename, binaryFile);

                  }

                  }

                  }
                  • 6. Re: GeneratePDFService quick start code issue
                    Level 1
                    Thanks Micheal for sharing your sample code!

                    Could you please also share readFile and writeFile function's definition which you have used in above code ?.

                    Regards,
                    Arvind
                    • 7. Re: GeneratePDFService quick start code issue
                      Level 1
                      Hi Micheal,

                      Now I am able to solve readFile and WriteFile function problem. And I don't need the function definitions for them now.

                      Thanks again for the help you provided.

                      The code provided by you works fine. But I think the above code doesn't use DIME attachment concept. So Still, I wanted to know from the Adobe team, why the WebReference of GeneratePDFService does not have GeneratePDFServiceServiceWse class in it?.

                      Regards,
                      Arvind
                      • 8. Re: GeneratePDFService quick start code issue
                        Hodmi Level 4
                        Hi Arvind;

                        Sorry about not including the read/write binary code - to tell the truth I just copied mine from another web site ;-)

                        You are right in noting that I use a base64 encoded message rather than a DIME attachment. This is because I am using VisualStudio 2005 which uses the WSE 3.0 engine (part of .Net 2.0). Unfortunately Microsoft removed DIME support from WSE 3.0 in favor of MTOM. The Microsoft.Web.Services2.Dime namespace has been completely removed. Currently the Adobe LiveCycle ES 8.0x software doesn't support MTOM.

                        This means you are left with a few options:
                        - Manually replace WSE 3.0 with WSE 2.0 in your .Net application so you can use DIME
                        - Get a copy of Visual Studio 2003 that used WSE 2.0. I believe that this will create the classes you speak of.
                        - Use another message type (such as base64)
                        • 9. Re: GeneratePDFService quick start code issue
                          Level 1
                          Hi Michael,

                          Yes, I do have Visual Studio 2003.Net and WSE 2.0. But the Problem is that the url (http://localhost:8080/soap/services/GeneratePDFService?wsdl)that I am using for adding as Webreference doesn't have or create GeneratePDFServiceServiceWse class. And That's why I am n't able to create object for GeneratePDFServiceServiceWse class.

                          So my question to Adobe team is that, why the above-mentioned url doesn't have GeneratePDFServiceServiceWse class or is there any other url for that ?. For the information, I am using LiveCycle ES version 8.0.1.

                          Regards,
                          Arvind
                          • 10. Re: GeneratePDFService quick start code issue
                            Level 1
                            Hi Michael,

                            Now I am able to solve the GeneratePDFServiceServiceWse problem. I can see now, GeneratePDFServiceServiceWse class in Object Browser for the Webreference that I have added using the same url . I don't know why it wasn't coming earlier. Anyways now it is working fine.

                            Thanks again for the help!

                            Regards,
                            Arvind
                            • 11. Re: GeneratePDFService quick start code issue
                              can somebody help me .
                              I try the example to invoke the generatePdf Web service, which is given in the sdkhelp and i encounter an error :
                              An unexpected exception was encountered: ALC-PDG-1001-000: com.adobe.livecycle.generatepdf.client.InvalidParameterException: ALC-PDG-001-001-La configuration du travail est impossible à obtenir ou est incorrecte.
                              Invocation error.
                              Caused by: ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Invocation error.
                              what does that mean ?
                              thank for your help.
                              jpw
                              • 12. Re: GeneratePDFService quick start code issue
                                Hodmi Level 4
                                My French is pretty poor, but it looks like the error says something about the configuration being missing or incorrect. This could mean one of several things:

                                1 - LiveCycle ES Generator is not installed and running correctly - Check to see if you can convert the file using the AdminUI interface (Home > Services > LiveCycle PDF Generator ES > Create PDF)
                                2 - LiveCycle can't find the native application (Word, Excel, etc). The native application MUST be installed on the same server as LiveCycle
                                3 - The user under which the JBoss service is running (the credentials of whom are being used to run PDFG) does not have administrative access to the system. LiveCycle needs administrative rights to access the native applications.
                                • 13. Re: GeneratePDFService quick start code issue
                                  Level 1
                                  thank you for your help.
                                  I have found , in the example the securitysettings was "no security" , but i have installed livecycle in french so i have to put "aucune sécurité" as
                                  String adobePDFSettings = "Standard";
                                  String securitySettings = "Aucune sécurité";
                                  String fileTypeSettings = "Standard";

                                  // Send the conversion request to the GeneratePdf Service
                                  mapItem[] createPDFResults = svc.CreatePDF(inDoc, new FileInfo(strInputFileName).Name, fileTypeSettings, adobePDFSettings, securitySettings, null, null);

                                  thank you very much .
                                  jpw
                                  • 14. Re: GeneratePDFService quick start code issue
                                    jb1809 Level 1
                                    Assemble Web Service Quick Start Runtime--SAXException--defaultFontStyle

                                    Hello Users,

                                    I want to use the Assemble WS. When I run the QuickStart, I get a SAXException: "Invalid element in com.adobe.livecycle.assembler.client.AssemblerOptionSpec - defaultFontStyle"
                                    when the service is called. Can anyone advise me on what the problem/solution might be. I was hoping that the quickstart would run right out of the box. Thank you.

                                    Jesse
                                    • 15. Re: GeneratePDFService quick start code issue
                                      Hodmi Level 4
                                      The defaultFontStyle option sets a default font style to use when none is specified in the DDX. If you don't set the defaultFontStyle, Assembler will use its default: "font: normal normal 12pt 'Minion Pro'". Is it possible that font does not exist on the server?

                                      If you want to change the default font style, the format is the same as in the DDX Font attribute (http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/ddxRefMain.163.99.html )

                                      For Example: "normal normal normal/normal 'Times New Roman'"