3 Replies Latest reply on Feb 1, 2010 4:27 AM by Paul.Triffitt

    Content is not allowed in prolog Error or Original Data Returned?

    Paul.Triffitt

      I am attempting to port our current java web application from Forms Server 7, to Forms Server 8 ES, and are having difficulties with processFormSubmission.

       

      It seems that “processFormSubmission” does not process the document obtained from the servlet’s request.getInputStream(). As stated in the adobe specification if the processFormSubmission does not understand the document fomat it passes through the data without a change. This appears to be happening in this situation. The data in the request is the form client’s POST message which is the raw data from the HTML Form.

       

      This POST message comes from the HTML form generated successfully by renderHTMLForm function. This worked in our original Livecycle 7 Forms Server, However, now in v8 Forms Server ES it doesn’t work anymore. I tried to extract the post message with base64 and decompress it without any positive results. If the CONTENT_TYPE variable is set to application/vnd.adobe.xdp the data is passed through without any processing, if the CONTENT_TYPE variable is set to application/vnd.adobe.xdp+xml the function processFormSubmission returns an Exception with the error “The content is not allowed in prolog”, which indicates that data are not in XML format.

       

      The following is a sample of our Servlet code used to call processFormSubmission:

       

      // FormsServiceClient object is obrained from service factory with properties

      Properties connectionProps = new Properties();

      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");

      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceC lientFactoryProperties.DSC_EJB_PROTOCOL);

      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");

      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");

      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "pwd");

                                         

      //Create a ServiceClientFactory object

      ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

                                         

      //Create a FormsServiceClient object

      FormsServiceClient formsClient = new FormsServiceClient(myFactory);

       

      RenderOptionsSpec processSpec = new RenderOptionsSpec();

      processSpec.setLocale("en_GB");

       

      //adobe document created form request form client

      Document formData = new Document(request.getInputStream());

       

      // userAgent  -"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)"

      FormsResult formRes1 = formsClient.processFormSubmission

      (

      formData,

      "CONTENT_TYPE=application/vnd.adobe.xdp+xml",

      userAgent,

      processSpec

      );