Skip navigation
Currently Being Moderated

How to call preview release SOAP API from non-java environment (e.g. .NET)

Aug 20, 2007 6:01 AM

I've finally managed to get the Forms Server ES preview release installed and configured together with JBoss.

Now I want to try and call the SOAP API from a .NET project.

The only article I have on this is this:
Adobe - Developer Center : Developing a .NET web application using Adobe LiveCycle Forms

The articel looks useful (potentially), but the ES Preview Release doesn't offer any DLL client libraries such as "ICSharpCode.SharpZipLib.dll" mentioned in the article.

So, as an alternative I've tried generating a .NET class library from the WSDL definition at "http://localhost:8080/soap/services/FormsService?wsdl". This seems to generate a class library ok. But now I'm trying to understand what all the arguments are for the renderForm() and renderPDFForm() methods... My method calls seem to be getting SoapExceptions back so it feels as if I'm nearly there if only I could account for all the arguments correctly.

Is there a comprehensive description of these anywhere? All I've found so far is the java class library documentation for the FormServiceClient class methods, which isn't quite the same as what I'm trying to use.
 
Replies
  • Currently Being Moderated
    Aug 20, 2007 6:47 AM   in reply to (petesmith)
    Refer to the LiveCycle SDK at http://www.adobe.com/support/documentation/en/livecycle/ (under Develop) for all information on developing application with LiveCycle products.

    You can find a bunch of examples under the API Quick Start section.

    You can also find a .Net specific example under the section Invoking LiveCycle ES/Invoking LiveCycle ES Using Web Services/Creating a .NET client assembly

    Jasmin
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2007 9:09 AM   in reply to (petesmith)
    The Creating a .NET assembly topic is a general description of creating a .NET assembly that consumes a services native SOAP stack. As an example - this topic explains how to upload a form to the repository.

    However -- all Forms ES operations have examples that show SOAP invocation:

    http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/quic kStarts_Forms.11.1.html

    There are 10 Forms SOAP code examples. See the Rendering Interactive PDF Forms quick start.

    In addition -- most LiveCycle ES operations have a corresponding code example that shows how to perform the operation via web services and Java APIs.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2007 9:14 AM   in reply to (petesmith)
    ALso - when creating your proxy object - be sure to set the user name and password - as discussed in the web service section:

    FormsServiceService formsClient = new OutputServiceService();
    formsClient.Credentials = new System.Net.NetworkCredential("administrator", "password");
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2007 9:18 AM   in reply to (petesmith)
    Also - you may want to read this topic: Rendering an interactive PDF form using the web service API

    This topic provides step by step instructions on how to render a form using web services and is located at:

    http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/rend eringPDF.32.4.html
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2007 10:46 AM   in reply to (petesmith)
    IN LiveCycle ES - developers have to create their own proxy assemblies.

    2nd - what is happening is that the Preview release is using an old code base that does not match up wiht the docs. That is the cause of your problem. LiveCycle ES has new Form operations that require a lot fewer parameters. Here is the method signature that is used to render a PDF form:

    public BLOB renderPDFForm ( System.String formQuery , BLOB inDataDoc , PDFFormRenderSpec pdfFormRenderSpec , URLSpec urlSpec , mapItem[] attachments , System.Int64 pageCount , System.String locale , FormsResult renderPDFFormResult )

    This is the code base that lines up with the documenation. The method renderForm is no longer used.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2007 4:33 AM   in reply to (petesmith)
    You can get an evaluation of the 8.0.1 version on the developer web site. You don't have to purchase the product in order to try it. Just go ahead and download it from this URL:

    http://www.adobe.com/devnet/livecycle/

    Jasmin
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2007 5:01 AM   in reply to (petesmith)
    Here is Java code that uses Java proxy classes that were created using AXIS and the Forms service WSDL. ALthough it is not .NET code, it shows how to render a form by invoking the renderPDFForm operation. You should invoke renderPDFForm, not renderForm.

    The Java code is:

    com.adobe.idp.services.FormsServiceServiceLocator sl = new FormsServiceServiceLocator();
    FormsService formsOb = sl.getFormsService();
    ((javax.xml.rpc.Stub)formsOb)._setProperty(javax.xml.rpc.Stub.SERNAME_ PROPERTY, "administrator");
    ((javax.xml.rpc.Stub)formsOb)._setProperty(javax.xml.rpc.Stub.PASSWORD _PROPERTY, "password");

    //Specify file attachments to attach to the form
    FileInputStream fileAttachment = new FileInputStream("C:\\rideau1.jpg");
    BLOB attachment1 = new BLOB();
    int len = fileAttachment.available();
    byte []fileStream = new byte[len] ;
    fileAttachment.read(fileStream);
    attachment1.setBinaryData(fileStream);
    String fileName = "rideau1.jpg";

    //Create a HashMap object to store file attachments
    HashMap fileAttachments = new HashMap();
    fileAttachments.put(fileName, attachment1);

    //Create a PDFFormRenderSpec object
    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
    pdfFormRenderSpec.setCacheEnabled(new Boolean(true));

    //Specify URI values used by the Forms service
    URLSpec uriValues = new URLSpec();
    uriValues.setApplicationWebRoot("http://localhost:8080/FormsServiceCli entApp");
    uriValues.setContentRootURI("repository://");
    uriValues.setTargetURL("http://localhost:8080/FormsServiceClientApp/Ha ndleData");

    //Create class holder objects
    BLOBHolder outRenderPDFFormResultDoc = new BLOBHolder();
    FormsResultHolder formsResult = new FormsResultHolder();
    BLOBHolder blobHolder = new BLOBHolder();
    LongHolder longHolder = new LongHolder();
    StringHolder stringHolder = new StringHolder();

    //Invoke the renderPDFForm method to render
    //an interactive PDF form
    formsOb.renderPDFForm(
    "/Loan.xdp",
    null,
    pdfFormRenderSpec,
    uriValues,
    fileAttachments,
    blobHolder,
    longHolder,
    stringHolder,
    formsResult);

    //Create a BLOB object that contains form data
    BLOB formData = formsResult.value.getOutputContent();


    This example will be ported to .NET to show the exact .NET syntax.
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 21, 2007 1:04 PM   in reply to (petesmith)
    HI Pete,

    I ported the Java web service code example to .NET code. This .NET example works and renders a form.

    However - when you create your .NET assembly - be sure to change the URL in your proxy class from

    http://localhost:8080/soap/services/FormsService

    to

    http://localhost:8080/soap/services/FormsService?blob=base64

    This ensures that binary data is returned with the BLOB instance.

    Good luck and here is the .NET example (call renderPDFForm):

    try
    {
    FormsServiceService forms = new FormsServiceService ();
    forms.Credentials = new System.Net.NetworkCredential("administrator", "password");

    //Create a PDFFormRenderSpec object
    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
    pdfFormRenderSpec.cacheEnabled = new Boolean();
    pdfFormRenderSpec.locale="en_US";
    pdfFormRenderSpec.acrobatVersion = AcrobatVersion.auto;

    //Specify URLSpec values
    URLSpec uriValues = new URLSpec();
    uriValues.applicationWebRoot = "";
    uriValues.contentRootURI = "C:\\Adobe";
    uriValues.targetURL = "";

    //Create class holder objects
    FormsResult formsResult = new FormsResult();
    System.Int64 numPage = 0;
    string locale = "";

    //Invoke the renderPDFForm method to render
    //a PDF form
    forms.renderPDFForm(
    "Loan.xdp",
    null,
    pdfFormRenderSpec,
    uriValues,
    null,
    out numPage,
    out locale,
    out formsResult);

    //Create a BLOB object that contains form data
    byte[] formData = formsResult.outputContent.binaryData;

    //Write the Form to a file
    string FILE_NAME = "C:\\Adobe\\RenderedForm.pdf" ;
    FileStream fs2 = new FileStream(FILE_NAME, FileMode.OpenOrCreate);

    //Create a BinaryWriter object
    BinaryWriter w = new BinaryWriter(fs2);
    w.Write(formData);
    w.Close();
    fs2.Close();


    }
    catch (Exception ee)
    {
    Console.WriteLine("An unexpected exception was encountered: " + ee.Message + "\n" + ee.StackTrace);
    }
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 22, 2007 4:15 AM   in reply to (petesmith)
    The best thing is to use the Form Designer Help. Go under Help/LiveCycle Designer Help and do a search for "dynamically populate drop-down".

    The explanation should get you going.

    Jasmin
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 22, 2007 4:40 AM   in reply to (petesmith)
    You can also look at this post and follow Howard's technique. It didn't work for Form Guides but will work in your case.

    http://www.adobeforums.com/cgi-bin/webx/.3bc4bdbb/4

    Jasmin
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2007 6:59 AM   in reply to (petesmith)
    When I generate the .NET proxies, none of those secondary classes (e.g., BLOB, URLSpec, etc) have constructors. I've had to manually add this to the generated files. Is this expected?
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2007 11:16 AM   in reply to (petesmith)
    That is not expected behaviour. Each complex type ie - BLOB - should have a construtor. What tool did you use to generate the proxy cs file on which the assembly was based?
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 27, 2007 11:47 AM   in reply to (petesmith)
    WSDL.EXE or adding a Web Reference in the ID (which of course uses WSDL.EXE under the hood).

    Upon further investigation, it seems the problem is exclusive to CLR 1.1. .NET 2.0 seems to generate proper classes. Of course, the classes generated for C# 3.0 won't compile on the v1.1 CLR.

    Have these services been tested under 1.1 at all?
     
    |
    Mark as:
  • Currently Being Moderated
    Nov 21, 2007 5:15 AM   in reply to (petesmith)
    Hi, Scott.
    I've tried your .Net example, as well as writing my own applications, but I am getting this error:

    | [com.adobe.idp.um.webservices.WSSecurityHandler] errorCode:12803 errorCodeHEX:0x3203 message:WSSecurityHandler: cannot convert into document. Exception Message -- ; nested exception is: org.xml.sax.SAXParseException: Character reference "" is an invalid XML character.

    I've tried multiple form-templates, even those who ships with LCES, but I still get the same error. I am suspecting this to be a config-issue.
    Grateful for all help.
    Dag.
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 28, 2008 1:01 PM   in reply to (petesmith)
    Hi Scott,

    Please help me out.

    I'm trying to render a PDF making use of same above piece of code you provided. But I couldn't find the .JAR file that contains the below classes :

    com.adobe.idp.services.BLOB;
    com.adobe.idp.services.FormsService;
    com.adobe.idp.services.FormsServiceServiceLocator;
    com.adobe.idp.services.PDFFormRenderSpec;
    com.adobe.idp.services.URLSpec;
    com.adobe.idp.services.holders.BLOBHolder;
    com.adobe.idp.services.holders.FormsResultHolder;

    Please help me out, which JAR file consists the above classes.

    Thanks in advance.

    Regards
    VJ.
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 1, 2008 6:18 AM   in reply to (petesmith)
    Im writing a java file so i need to call a form over a button to perform some action.could you help me please
     
    |
    Mark as:
  • Currently Being Moderated
    Dec 15, 2008 10:13 AM   in reply to (petesmith)
    To get a JAR file that contains these packages:

    com.adobe.idp.services.BLOB;
    com.adobe.idp.services.FormsService;
    com.adobe.idp.services.FormsServiceServiceLocator;
    com.adobe.idp.services.PDFFormRenderSpec;
    com.adobe.idp.services.URLSpec;
    com.adobe.idp.services.holders.BLOBHolder;
    com.adobe.idp.services.holders.FormsResultHolder;

    requires that you create your own Java proxy files using AXIS. See this URL:

    Creating Java proxy classes using Apache Axis that uses encoding

    at: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000 281.html
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)