0 Replies Latest reply on Aug 25, 2011 3:25 AM by Remyasree

    Assembler Service (8.2) - Service gets executed successfully but does not return assembled pdf

    Remyasree Level 1

       

      Hi Guys ,

       

      I have invoked assembler service on LC server with a java web service client for version 8.2. The stubs were generated with Axis2. The service gets executed successfully, however the result does not return an assembled pdf, the BOLB value expected is returned as null.

       

       

      Could you please point me what I might have done wrong?

       

       

      The server logs are positive:

       

      ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ ---------------------------------------------

       

      2011-08-23 16:56:57,929 INFO  [com.adobe.livecycle.assembler.AssemblerServiceImpl] ALC-ASM-N00-001: Execute: invoke() end on thread http-0.0.0.0-8080-33 229594

       

      2011-08-23 16:57:39,414 INFO  [com.adobe.livecycle.assembler.AssemblerServiceImpl] ALC-ASM-N00-001: Execute: invoke() begin on thread http-0.0.0.0-8080-41 229604

       

      2011-08-23 16:57:39,429 INFO  [com.adobe.internal.ddxm.Executive] DDXM_N00000: Started processing result named out.pdf

       

      2011-08-23 16:57:39,460 INFO  [com.adobe.internal.ddxm.Executive] DDXM_N00001: Successful assembly of result named out.pdf

       

      2011-08-23 16:57:39,492 INFO  [com.adobe.livecycle.assembler.AssemblerServiceImpl] ALC-ASM-N00-001: Execute: invoke() end on thread http-0.0.is 0.0-8080-41 229604

       

      This is the DDX :

       

      <?xml version="1.0" encoding="UTF-8"?>

       

       

       

      <DDX xmlns="http://ns.adobe.com/DDX/1.0/">

       

           <PDF result="out.pdf">

       

               <PDF source="env-template-assp.pdf" />

       

               <PDF source="estatement.pdf" />

       

           </PDF>

       

      </DDX>

       

      My client code :

       

      public class AssemblePDFSWAref {

       

          public static void main(String[] args)

          {

             

           

             try

              {

                 

                 

                  AssemblerServiceServiceStub stub = new AssemblerServiceServiceStub("http://xxx:8080/soap/services/AssemblerService?WSDL&lc_version=8.2.1");

              

                  String username = "administrator";

                  String password = "password";

                 

                  HttpTransportProperties.Authenticator basicAuthentication = new HttpTransportProperties.Authenticator();

                        basicAuthentication.setUsername(username);

                        basicAuthentication.setPassword(password);

                       

                        stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPCons tants.AUTHENTICATE, basicAuthentication);

       

                       

                        String path = "E:\\pdfs\\shell.xml";

                       

                       

                       

                  FileDataSource ds = new FileDataSource(path);

                  DataHandler handler = new DataHandler(ds);

                  BLOB ddx = new BLOB();

                  ddx.setBinaryData(handler);

                       

                        String path2 = "E:\\pdfs\\env-template-assp.pdf";

                       

                       

                       

                      FileDataSource ds2 = new FileDataSource(path2);

                      DataHandler handler2 = new DataHandler(ds2);

                      BLOB doc1 = new BLOB();

                      doc1.setBinaryData(handler2);

                    

                    

                     

                      String path3 = "E:\\pdfs\\estatement.pdf";

                     

                     

                     

                  FileDataSource ds3 = new FileDataSource(path3);

                  DataHandler handler3 = new DataHandler(ds3);

                  BLOB doc2 = new BLOB();

                  doc2.setBinaryData(handler3);

                 

                

                 

                  Map docItem=new Map();

                 

                  MapItem param1=new MapItem();

                  param1.setKey("env-template-assp.pdf");

                  param1.setValue(doc1);

                  docItem.addItem(param1);

                 

                  MapItem param2=new MapItem();

                  param2.setKey("estatement.pdf");

                  param2.setValue(doc2);

                  docItem.addItem(param2);

               

                 

                 

                  Invoke invoke=new Invoke();

                 

                  AssemblerOptionSpec param=new AssemblerOptionSpec();

                  param.setFailOnError(true);

                 

                  invoke.setInputs(docItem);

                  invoke.setInDDXDoc(ddx);

                  invoke.setEnvironment(param);

                  InvokeResponse result1=stub.invoke(invoke);

                 

                 

                 

                  AssemblerResult result =result1.getResult();

                 

                 

                  BLOB outDoc = null;

                  MapItem[] mapResult = result.getDocuments().getItem();

                  for(int i=0;i<mapResult.length;i++)

                  {

               

                  {

                      MapItem resultItem = mapResult[i];

                      String myKey = (String)(resultItem.getKey());

       

                      if (myKey.equals("out.pdf"))

                      {

                          outDoc = (BLOB)(resultItem.getValue());

                         

                      }

                  }

       

                  File f = new File("C:\\pdfs\\AssemblerResultPDF.pdf");

                  BLOB outBlob = outDoc;

                  DataHandler handler4 = outBlob.getBinaryData();

                  InputStream inputStream = handler4.getInputStream();

                  OutputStream out = new FileOutputStream(f);

                 

               

                  byte buf[] = new byte[1024];

                  int len;

                  while ((len = inputStream.read(buf)) > 0)

                      out.write(buf, 0, len);

                  out.close();

                  inputStream.close();

       

                  }

                 

              }

              catch(Exception e)

              {

                 

                  e.printStackTrace();

                 

              }

              finally

              {

                 

              }

          }

         

      }

       

      ---------------------------------------------------------------------------

       

      Thanks