How to validate an XML with its XSD in jdk1.4.2_09?

Hi all,
Kindly Tell me how to validate an Xml against an XSD in JDK1.4.2_09....
I was able to do it in jdk1.5 using the Validation class available in java.xml.validation package...
But the Task for me is to do in jdk1.4.2 since my application server runs on jdk1.4.2... changin to jdk1.5 will result in failure of main application...
sample code will be useful...
thanks in advance.
Regards,
Sundararamaprasad.

HI,
Thanks for the suggestion.... The Thing is when i compiled and executre my code it really got execute well when i ran it in the Command Prompt after settiongup appropriate classpath and path... but when i executed the same thing in the server it did not get executed though the application server also run on top of the same JDk.....I've check it out..anyhow the link gave me a very good learning...Thanks for the valuable suggestion..... :)
Regards,
Sundararamaprasad.

Similar Messages

  • Adapter Module: Validate an XML with an XSD

    Hello all,
    I'm developing a PI adapter module (Exchange Infrastructure 3.0) for the Mail Adapter. In this module I need to get each XML attachment and then validate with an XSD schema, for this I'm using the SAX parser.
    I successfully retrieved all XML attachments but when I'm trying to use the method setProperty of the SAXParser instance I'm getting an exception, bellow the code snippet.
         private static final String SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         private static final String SCHEMA_SOURCE   = "http://java.sun.com/xml/jaxp/properties/schemaSource";
         private static final String XML_SCHEMA      = "http://www.w3.org/2001/XMLSchema";
         public boolean isValid(byte[] src, AuditMessageKey amk1){
              SAXParserFactory spf = SAXParserFactory.newInstance();
              SAXParser sp = null;
              spf.setNamespaceAware(true);
              spf.setValidating(true);
              String[] schemas = new String[MAX_SCHEMAS];
              schemas[0] = getClass().getResource(SCHEMA1).getFile();
              schemas[1] = getClass().getResource(SCHEMA2).getFile();
              schemas[2] = getClass().getResource(SCHEMA3).getFile();
              try {
                   sp = spf.newSAXParser();
              catch (Exception e){
                   Audit.addAuditLogEntry(amk1, AuditLogStatus.ERROR, "MultipleAttachments: Error creating parser.");
                   return false;
    // HERE IS THE STEP THROWING THE EXCEPTION
              try {
                   sp.setProperty(SCHEMA_LANGUAGE, XML_SCHEMA);
              catch (Exception e){
                   Audit.addAuditLogEntry(amk1, AuditLogStatus.ERROR, "MultipleAttachments: Error setting schema.");
                   return false;
    Did Anyone have faced this issue? How can I solve this?
    Best regards,
    David

    Hi David,
    we developed a xsd validation with java mapping.
    SAP has it's own parser. At the time we developed there was a bad bug in this parser. The parser throwed a fatal error although the xml was valid!
    SAP corrected the error. But this is over 1,5 years ago. I recommend a OSS .
    Regards Mario

  • How to validate an xml with a schema w/o specifying the schema in the xml

    I have done xml validation with xml schemas, where the xml points to the xsd to use. However, I would like to not have to specifiy the xml schema in the xml document (and can't ensure that the xml coming to us has that in it). How do I, in the java code, tell it what schema to use in validation?
    Brian

    static final String schemaSource = argv[0];
    static final String JAXP_SCHEMA_SOURCE =
    "http://java.sun.com/xml/jaxp/properties/schemaSource";
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    factory.setAttribute(JAXP_SCHEMA_SOURCE,
    new File(schemaSource));

  • How to validate sales doc with its sales area

    Hi experts,
    how can i check perticular sales doc is extended to its sales area.
    i need to do validation for sales doc against  sales area.
    which table do i need to use for this,
    Thanks,
    Neo

    You can use VBAk Table
    Thanks
    Seshu

  • HOW TO KNOW VALID XML WITH DTD ? WITHOUT PARSING  ?

    i am creating the xml file
    i need to validate the xml with DTD to confirm is it valid or not ?
    with out parsing...
    could you tell me how ?
    Durga

    without parsing u cant do it..

  • How to create a window with its own window border other than the local system window border?

    How to create a window with its own window border other than the local system window border?
    For example, a border: a black line with a width 1 and then a transparent line with a width 5. Further inner, it is the content pane.
    In JavaSE, there seems to have the paintComponent() method for the JFrame to realize the effect.

    Not sure why your code is doing that. I usually use an ObjectProperty<Point2D> to hold the initial coordinates of the mouse press, and set it to null on a mouse release. That seems to avoid the dragging being confused by mouse interaction with other nodes.
    import javafx.application.Application;
    import javafx.application.Platform;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.collections.FXCollections;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Point2D;
    import javafx.geometry.Pos;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.Window;
    public class CustomBorderExample extends Application {
      @Override
      public void start(Stage primaryStage) {
      AnchorPane root = new AnchorPane();
      root.setStyle("-fx-border-color: black; -fx-border-width: 1px; ");
      enableDragging(root);
      StackPane mainContainer = new StackPane();
        AnchorPane.setTopAnchor(mainContainer, 5.0);
        AnchorPane.setLeftAnchor(mainContainer, 5.0);
        AnchorPane.setRightAnchor(mainContainer, 5.0);
        AnchorPane.setBottomAnchor(mainContainer, 5.0);
      mainContainer.setStyle("-fx-background-color: aliceblue;");
      root.getChildren().add(mainContainer);
      primaryStage.initStyle(StageStyle.TRANSPARENT);
      final ChoiceBox<String> choiceBox = new ChoiceBox<>(FXCollections.observableArrayList("Item 1", "Item 2", "Item 3"));
      final Button closeButton = new Button("Close");
      VBox vbox = new VBox(10);
      vbox.setAlignment(Pos.CENTER);
      vbox.getChildren().addAll(choiceBox, closeButton);
      mainContainer.getChildren().add(vbox);
        closeButton.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            Platform.exit();
      primaryStage.setScene(new Scene(root,  300, 200, Color.TRANSPARENT));
      primaryStage.show();
      private void enableDragging(final Node n) {
       final ObjectProperty<Point2D> mouseAnchor = new SimpleObjectProperty<>(null);
       n.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            mouseAnchor.set(new Point2D(event.getX(), event.getY()));
       n.addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            mouseAnchor.set(null);
       n.addEventHandler(MouseEvent.MOUSE_DRAGGED, new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            Point2D anchor = mouseAnchor.get();
            Scene scene = n.getScene();
            Window window = null ;
            if (scene != null) {
              window = scene.getWindow();
            if (anchor != null && window != null) {
              double deltaX = event.getX()-anchor.getX();
              double deltaY = event.getY()-anchor.getY();
              window.setX(window.getX()+deltaX);
              window.setY(window.getY()+deltaY);
      public static void main(String[] args) {
      launch(args);

  • How to validate an XML file with XSD Schema on JDK 1.4

    Hi
    I'm looking for samples how to validate xml files with xsd schema using jsdk 1.4
    Thank you.

    This is how.
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.validation.Schema;
    import javax.xml.validation.SchemaFactory;
    import javax.xml.validation.Validator;
    DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
    dbfac.setNamespaceAware(true);
    SchemaFactory factory1 = SchemaFactory
                        .newInstance("http://www.w3.org/2001/XMLSchema");
    Schema schema = factory1.newSchema(new File("person.xsd"));
    dbfac.setSchema(schema);
    DocumentBuilder dbparser1 = dbfac.newDocumentBuilder();
    Document doc1 = dbparser1.parse(new File("person.xml"));
    Validator validator1 = schema.newValidator();
    DOMSource dm1 = new DOMSource(doc1);
    DOMResult domresult1 = new DOMResult();
    validator1.validate(dm1, domresult1);

  • How to get XML from its XSD?

    Hi
    I need to get the XML template from its XSD. Please help me understand how do I do this using a java code. Based on XSD I have to generate the XML template, which I am going to fill later.
    In case there is no standard API available; then please suggest how effective will it be to parse the XDS and generate XML myself. What all consideration must be taken care of?
    Regards
    Vijendra

    Indeed, the best choice is to use an XML editor that has support for this kind of operation.
    In case you want to generate sample XML files with more complex conditions, oXygen (http://www.oxygenxml.com/) has such a feature : Tools->Generate Sample XML Files. ( http://www.oxygenxml.com/xml_schema_editor.html#xml_schema_instance_generator )
    StylusStudio has an XML generator too:(http://www.stylusstudio.com/xml_generator.html)
    But if you want to write your own generator in Java , I suggest to look at http://www.sun.com/software/xml/developers/instancegenerator/

  • How to validate the Xml File With Java

    Hi,
    Can pls tell me. I want to validate the XML File for the Some Mandartory TAG. if that if Tag null i want to generate error xml file with error and i want move another folder with java. pls help me as soon as possible

    Use a validating parser (any recent Xerces, for one) and switch on the validation feature. Very much vendor-specific, so look at the docs of your parser. Oh, you do have a schema for these documents, don't you?

  • Validating XML with its DTD in JSP

    Is there a way to validate an XML file with its DTD, using a JSP ???
    If YES, then HOW???
    I hope my question is clear enough.
    Please help!!

    Thanks "Jleech",
    I am using a textarea in a JSP to input for an XML file. The JSP transfers the file to Web-Server, which also has XERCES installed. My question is how can u Validate this transfered XML file with its DTD. My problem is I don't to how to include that Validation program in JSP.?
    Could you still help???

  • Managing XMl with its metadata.

    I have several XML files in my repository. They are using a registered schema, so are not stored as CLOB.
    I made several views+indexes that shows some XML node values in RDBMS manner.
    Now I need to manage my XML with their metadata (mostly ResExtra).
    I read the doc, and it seems that the only way to reach metadatas is via the PATH_VIEW/RESOURCE_VIEW.
    So if I want to use statements that provides both data+metadata, I will have to use the PATH_VIEW in my FROM clause and the EQUALS_PATH/UNDER_PATH in my WHERE clause. Is there another way to retrieve metadata, given
    a XMLType?
    Can I make indexes for those queries? ie. can I make indexes over the PATH_VIEW ?

    Thanks "Jleech",
    I am using a textarea in a JSP to input for an XML file. The JSP transfers the file to Web-Server, which also has XERCES installed. My question is how can u Validate this transfered XML file with its DTD. My problem is I don't to how to include that Validation program in JSP.?
    Could you still help???

  • How to validate an XML file in BPEL ?

    Hi All,
    I have 2 Bpel processes.
    One for creating supplier and one for formate Validations.
    I am having problems with formate Validations.
    I am trying to validate an xml file that is passed to my Bpel Process (SupplierValidation).
    My process contains the following:
    I have a client which its property Name is set to ValidateXML and its value set to true.
    I have a recieve activity and a reply out !
    very simple process, but its working !
    This process is synchronous.
    Help is needed !
    Thanks,
    aj

    you have to use bpelx:validate as sown below
    <bpelx:validate variables="inputVariable" name="ValidateInputXML"/>

  • How to validate EDI XML payload against ECS file

    Hi All,
    How to validate an EDI XML against ecs file.
    Can you please provide steps.
    Sample EDI XML i am trying to validate against EDI_4010_850.ecs
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <Transaction-850 xmlns:ns1="urn:oracle:b2b:X12/V4010/850" Standard="X12" xmlns="urn:oracle:b2b:X12/V4010/850">
    <ns1:Segment-ST>
    <ns1:Element-143>850</ns1:Element-143>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-ST>
    <ns1:Segment-BEG>
    <ns1:Element-353>00</ns1:Element-353>
    <ns1:Element-92>NE</ns1:Element-92>
    <ns1:Element-324>12345678</ns1:Element-324>
    <ns1:Element-373>20140703</ns1:Element-373>
    </ns1:Segment-BEG>
    <ns1:Loop-PO1>
    <ns1:Segment-PO1>
    <ns1:Element-350>001</ns1:Element-350>
    <ns1:Element-330>1</ns1:Element-330>
    <ns1:Element-212>96</ns1:Element-212>
    <ns1:Element-639>AA</ns1:Element-639>
    <ns1:Element-235_1>VC</ns1:Element-235_1>
    <ns1:Element-234_1>571157</ns1:Element-234_1>
    <ns1:Element-235_2>CB</ns1:Element-235_2>
    <ns1:Element-234_2>00100</ns1:Element-234_2>
    </ns1:Segment-PO1>
    <ns1:Loop-PID>
    <ns1:Segment-PID>
    <ns1:Element-349>F</ns1:Element-349>
    <ns1:Element-352>Rockford product</ns1:Element-352>
    </ns1:Segment-PID>
    </ns1:Loop-PID>
    <ns1:Segment-DTM>
    <ns1:Element-374>038</ns1:Element-374>
    <ns1:Element-373>20140626</ns1:Element-373>
    </ns1:Segment-DTM>
    <ns1:Loop-AMT>
    <ns1:Segment-AMT>
    <ns1:Element-522>1</ns1:Element-522>
    <ns1:Element-782>1</ns1:Element-782>
    </ns1:Segment-AMT></ns1:Loop-AMT>
    </ns1:Loop-PO1>
    <ns1:Segment-SE>
    <ns1:Element-96>#SegmentCount#</ns1:Element-96>
    <ns1:Element-329>000000010</ns1:Element-329>
    </ns1:Segment-SE>
    </Transaction-850>
    Thanks,
    Sid.

    What We have done is, took the XML which we are passing to B2B and assigned the XSD_PO_850 schema to it and validated. Its showing as Valid. Not sure, where the issue is now?

  • How to save as XML with some predefined extensions

    hi All,
    In my application a template has to be created which should contain field headers and their respective field types - example field header LEVEL and field type COMBO BOX. Purpose is - a table will be created based on the fields in the template. Now I want to save this template as XML file with some predefined extension (like .templ). Later in my application i will retreive the saved template and use it to create table.
    How can i save the file as XML with some predefined extension. We are using Swing to create template. Please help me with sample programs to solve this problem.
    awaiting for your mail
    Thank you
    Regards
    MKumar

    In an other post I found my solution thanks to "Peggy" :
    Save As… has returned with Mountain Lion. Hold down the Option/alt key while clicking on the File menu & there it is! It also has a default keyboard shortcut.
    Thank you Peggy

  • How to validate PDF document with JAVA

    Hi,
    Is there any way to write JAVA app that will validate PDFs through/with LC API ? I was traying with code:
    ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
    FormsServiceClient formsClient = new FormsServiceClient(myFactory);
    FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient);        
    RenderOptionsSpec processSpec = new RenderOptionsSpec();
    //processSpec.setValidationReporting(5);
    processSpec.setLocale("pl_PL");
    FormsResult formOut = formsClient.processFormSubmission(renderedForm.getOutputContent(),"CONTENT_TYPE=applicati on/pdf","",processSpec);
    System.out.println(formOut.getValidationErrorsList().toString());
    //Rendering method
    private static FormsResult renderPDF(String formName,String  xmlData, String url, FormsServiceClient formsClient) throws RenderFormException, DSCException, UnsupportedEncodingException {
             PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
             pdfFormRenderSpec.setCacheEnabled(new Boolean(false));
             pdfFormRenderSpec.setXMLData(true);
             pdfFormRenderSpec.setStandAlone(true);
             pdfFormRenderSpec.setLinearizedPDF(true);
             URLSpec urlSpec = new URLSpec();
             urlSpec.setContentRootURI(url);
             String credentialAlias = CREDENTIAL_ALIAS;
             String credentialPassword = CREDENTIAL_PASSWORD;
             ReaderExtensionSpec reOptions = new ReaderExtensionSpec();
             reOptions.setReCredentialAlias(credentialAlias);
             reOptions.setReCredentialPassword(credentialPassword);
             reOptions.setReExpImp(true);
             reOptions.setReFillIn(true);
             reOptions.setReDigSig(true);
             Document inputData = new Document(xmlData.getBytes("UTF-8"));
             /*return renderedForm = formsClient.renderPDFForm(formName,inputData,pdfFormRenderSpec,urlSpec,null);*/
             return formsClient.renderPDFFormWithUsageRights(formName,inputData,pdfFormRenderSpec,reOptions,u rlSpec);
    but in formOut.getValidationErrorsList() i still get:
    [8/2/10 12:03:46:728 GMT+01:00] 0000002c SystemOut     O --------------------Validation------------
    [8/2/10 12:03:46:728 GMT+01:00] 0000002c SystemOut     O <document state="active" senderVersion="3" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false" deserialized="true" senderHostId="127.0.0.1/172.16.133.24/172.16.134.24" callbackId="0" senderCallbackId="0" callbackRef="null" isLocalizable="false" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="0" contentType="null" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGl obalBackendId/><inline></inline><senderPullServantJndiName>adobe/idp/DocumentPullServant/a dobews_anathNode01Cell_anathNode02_server1</senderPullServantJndiName><attributes/></docum ent>
    without any errors. I was looking around (google,forum and Adobe Develop Connection) but no luck . Is it posible to make it that way ?
    Ps.
    It's my first post so (if i did something wrong ) be gentle. And ... sorry for my poor english .

    I modified code for rendering form and for validating and I start to get erros on output, but that is not complete list
    <document state="active" senderVersion="3" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false"
    deserialized="true" senderHostId="127.0.0.1/172.16.133.24/172.16.134.24" callbackId="0" senderCallbackId="0" callbackRef="null"
    isLocalizable="false" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536"
    defaultMaxInlineSize="65536" inlineSize="342" contentType="text/xml" length="-1">
    <cacheId/>
    <localBackendId/>
    <globalBackendId/>
    <senderLocalBackendId/>
    <senderGlobalBackendId/>
    <inline>
        <?xml version="1.0" encoding="UTF-8"?>
        <validationErrors>
        <m d="2010-08-04T10:05:48.897+02:00" ref="...
    </inline>
    <senderPullServantJndiName>adobe/idp/DocumentPullServant/adobews_anathNode01Cell_anathNode 02_server1</senderPullServantJndiName>
    <attributes/>
    </document>
    it is cut in place where should be reference to wrong field.
    <inline>
         <?xml version="1.0" encoding="UTF-8"?>
         <validationErrors>
         <m d="2010-08-04T10:05:48.897+02:00" ref="...
    </inline>
    I attach whole class after changes:
    public class AdobeForm {
        private static final String CREDENTIAL_ALIAS  = "READER_EXC_CERT";
        private static final String IIOP = "iiop://localhost:2810";
        private static final String CREDENTIAL_PASSWORD = "pass";
        private static final String AS_USERNAME = "log";
        private static final String AS_PASSWORD = "pass";
        private static final String NO_ERRORS = "";
        public static byte[] renderForm(String formName,String  xmlData, String url){
            byte[] data = null;
            try
                //JBOSS
    /*            Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL", "EJB");
                connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "log");
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "pass");*/
               // dla WebSphere
                Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", IIOP);
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");         
                connectionProps.setProperty("DSC_SERVER_TYPE", "WebSphere");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", AS_USERNAME);
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", AS_PASSWORD);
                ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                FormsServiceClient formsClient = new FormsServiceClient(myFactory);
                FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient, false);
                //test(renderedForm);
                Document renderedFormData = renderedForm.getOutputContent();
                InputStream inputStream = renderedFormData.getInputStream();
                // to pewnie trzeba poprawic na przepisywanie duzych danych
                int size = inputStream.available();
                data = new byte[size];
                inputStream.read(data);
                inputStream.close();
            catch (Exception e)
                e.printStackTrace();
            return data;
        public static byte[] validateForm(String formName, String xmlData, String url){
            byte[] data = null;
            try
                //JBOSS
                Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://localhost:1099");
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL", "EJB");
                connectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");*/
                // dla WebSphere
                Properties connectionProps = new Properties();
                connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", IIOP);
                connectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");         
                connectionProps.setProperty("DSC_SERVER_TYPE", "WebSphere");
                connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", AS_USERNAME);
                connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", AS_PASSWORD);
                ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
                FormsServiceClient formsClient = new FormsServiceClient(myFactory);
                FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient, true);        
                RenderOptionsSpec processSpec = new RenderOptionsSpec();
                processSpec.setValidationUI(0);
                processSpec.setValidationReporting(10);
                processSpec.setCacheEnabled(true);
                //processSpec.setXMLData(true);
                //processSpec.setDebugEnabled(true);
                /*processSpec.setLocale("pl_PL");
                processSpec.setStandAlone(true);*/
                FormsResult formOut = formsClient.processFormSubmission(renderedForm.getXMLData(),
                        "I=application/pdf&CONTENT_TYPE=application/vnd.adobe.xdp+xml",
                        "",processSpec);
    /*            Document inputData = new Document(xmlData.getBytes("UTF-8"));
                FormsResult formOut = formsClient.processFormSubmission(inputData,
                        "CONTENT_TYPE=application/pdf&CONTENT_TYPE=application/vnd.adobe.xdp+xml&CONTENT_TYPE=tex t/xml",
                        "",processSpec);*/
                test(formOut);
                // to pewnie trzeba poprawic na przepisywanie duzych danych
                InputStream inputStream = formOut.getOutputContent().getInputStream();
                int size = inputStream.available();
                data = new byte[size];
                inputStream.read(data);
                inputStream.close();
                System.out.println("Dane: "+(new String(data)));
                System.out.println("------------------------------------------");
                System.out.println("OutputXML: "+formOut.getOutputXML());
                return NO_ERRORS.getBytes();
            catch (Exception e)
                e.printStackTrace();
            return NO_ERRORS.getBytes();
        private static void test(FormsResult formOut) {
            if(formOut != null)
                System.out.println("------------------------------------------");
                System.out.println("--------------------Validation------------");
                System.out.println(formOut.getValidationErrorsList());
                System.out.println("------------------------------------------");
                System.out.println("------------------------------------------");   
            else
                System.out.println("-------------------FORMOUT NULL-----------------------");   
        @SuppressWarnings("unused")
        private static void showData(String xmlData, String formName, String url) {
            System.out.println("------------------XML------------------------");
            System.out.println("XML: "+xmlData);
            System.out.println("Form: "+formName);
            System.out.println("URL: "+url);
            System.out.println("------------------XML------------------------");
        private static FormsResult renderPDF(String formName,String  xmlData, String url, FormsServiceClient formsClient, boolean renderedForm) throws RenderFormException, DSCException, UnsupportedEncodingException {
             URLSpec urlSpec = new URLSpec();
             urlSpec.setContentRootURI(url);
             PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
             pdfFormRenderSpec.setCacheEnabled(true);
             pdfFormRenderSpec.setXMLData(true);
    /*       pdfFormRenderSpec.setDebugEnabled(true);
             pdfFormRenderSpec.setLocale("pl_PL");
             //without rights
             if(renderedForm)//see bellow
                 pdfFormRenderSpec.setLinearizedPDF(true); */
             System.out.println("RenderServlet formName "+formName);  
             String credentialAlias = CREDENTIAL_ALIAS;
             String credentialPassword = CREDENTIAL_PASSWORD;
             Document inputData = new Document(xmlData.getBytes("UTF-8"));
             if(renderedForm)
                 return formsClient.renderPDFForm(formName,inputData,pdfFormRenderSpec,urlSpec,null);
             else
                 ReaderExtensionSpec reOptions = new ReaderExtensionSpec();
                 reOptions.setReCredentialAlias(credentialAlias);
                 reOptions.setReCredentialPassword(credentialPassword);
                 reOptions.setReExpImp(true);
                 reOptions.setReFillIn(true);
                 reOptions.setReDigSig(true);
                 pdfFormRenderSpec.setStandAlone(true);
                 return formsClient.renderPDFFormWithUsageRights(formName,inputData,pdfFormRenderSpec,reOptions,u rlSpec);
             //[8/4/10 11:10:55:928 GMT+01:00] 0000002a CommonGibsonU W com.adobe.livecycle.formsservice.logging.FormsLogger logMessage ALC-FRM-001-048: Forms with Rights cannot be linearized.

Maybe you are looking for

  • In the Production Order, Sales Quotation is displayed not the Sales Order

    Hello to All, I need a kind help from you. My scenario is as follows There is a Configurable Material (Finished Product) Sales quotation (VA21/2/3) were made for this material. Sales Order (VA01/2/3) with reference from the Sales Quotation were made

  • Upgrade : Issue with Specical character being used in 4.6C ( Dynamic calls)

    Hi ,   We are working on Upgrade from 4.6C to ECC6.0 . in SPAU phase we are facing an issue : When we are trying to see the variants from the program, it says that the program contains Syntax Error "In Unicode programs, the "&" character can not appe

  • Datasources showing information in different formats,

    Hi , I have 2 datasources, one is a standard datasource and the other is a generic datasource that is got from the catsdb table in r/3. Im pulling in information from both but I am looking for the one common field in both to make the data relate. Thi

  • Typing on PDF document (iPad)

    does anyone know if I can type a document (PDF ) on Adobe reader . I have an apple iPad?.

  • About how to use WHERE condition in JDBC

    Hello, I met a problem when I wrote my jdbc program. ResultSet rs1 = stmt1.executeQuery("select Ncategory from ncategory, whsites where whsites.Name = 'Heard and McDonald Islands'and whsites.Id=ncategory.IdWhsites"); ncategory and whsites are my two