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"/>

Similar Messages

  • 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?

  • 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 use Xerces to validate an XML file against a DTD

    Hi, can anybody tell me how to use Xerces to validate an XML file against a DTD. its urgent. post some sample code. it would be helpful for my project. isupposed to use SAX parser(Xerces)
    Thanx in advance

    Come on, I googled "xerces validate" and the first link is the Xerces FAQ:
    http://xerces.apache.org/xerces-j/faq-general.html
    And of course "how to validate" is a Xerces FAQ. Help yourself by doing a little research instead of waiting for other people.

  • Validate a XML file against multiple schema files

    Hello everybody!
    How can I validate a XML file against multiple schema files?
    I have the following XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <bulkCmConfigDataFile xmlns:es="SpecificAttributes.3.0.xsd"
                             xmlns:xn="genericNrm.xsd"
    xmlns="configData.xsd">
    <fileHeader fileFormatVersion="32.615 V4.2" vendorName=""/>
    <configData dnPrefix="Undefined">
    <xn:SubNetwork id="3G">
    <xn:SubNetwork id="RNC01">
    <xn:MeContext id="RNC01">
    <xn:VsDataContainer id="RNC01">
    <xn:attributes>
    <xn:vsDataType>vsDataMeContext</xn:vsDataType>
    <xn:vsDataFormatVersion>SpecificAttributes.3.0</xn:vsDataFormatVersion>
    <es:vsDataMeContext>
    <es:userLabel>RNC01</es:userLabel>
    <es:ipAddress>172.21.3.17</es:ipAddress>
    <es:neMIMversion>vF.5.0</es:neMIMversion>
    </es:vsDataMeContext>
                                  </xn:attributes>
    </xn:VsDataContainer>
    </xn:MeContext>
    </xn:SubNetwork>
    </xn:SubNetwork>
    </configData>
    <fileFooter dateTime="2006-11-24T11:56:07Z"/>
    </bulkCmConfigDataFile>
    I want to load this file into a table, validate it (against SpecificAttributes.3.0.xsd, genericNrm.xsd and configData.xsd) and query that table. How would the INSERT .. and the SELECT ... for userLabel attribute look like?
    Many thanks!

    Hi Peter,
    Please use the validateXML BPEL Property : This property validates incoming and outgoing XML documents. If set to true, the Oracle BPEL Process Manager applies schema validation for incoming and outgoing XML documents. This property is applicable to both durable and transient processes. The default value is false.
    Cheers
    A

  • Can I validate an XML file using an external DTD

    Hi,
    I'm trying to use an external DTD to validate an XML
    file (which does not refer to this DTD). The java docs that ship
    with the XML parser aren't clear on how exactly to do this (or
    whether it can be done). I'd appreciate any advice on how I
    should perform this operation.
    Here's what I'm doing right now.
    1) The Java file
    import oracle.xml.parser.v2.*;
    public class ParseWithExternalDTD
    public static void main(String args[]) throws Exception
    DOMParser dp=new DOMParser();
    dp.parseDTD
    ("file:d:/jdk1.2/sample/test/family.DTD","family");
    DTD dtd=dp.getDoctype();
    dp.setDoctype(dtd);
    dp.parse("file:d:/jdk1.2/sample/test/family.xml");
    System.out.println("Finished with no errors!");
    2) The family.DTD file
    <!ELEMENT family (member*)>
    <!ATTLIST family lastname CDATA #REQUIRED>
    <!ELEMENT member (#PCDATA)>
    <!ATTLIST member memberid ID #REQUIRED>
    <!ATTLIST member dad IDREF #IMPLIED>
    <!ATTLIST member mom IDREF #IMPLIED>
    3) The family.xml file
    <?xml version="1.0" standalone="no"?>
    <family lastname="Smith">
    <TagToFoilParserValidation>
    </TagToFoilParserValidation>
    <member memberid="m1">Sarah</member>
    <member memberid="m2">Bob</member>
    <member memberid="m3" mom="m1" dad="m2">Joanne</member>
    <member memberid="m4" mom="m1" dad="m2">Jim</member>
    </family>
    4) The output
    Finished with no errors!
    As you can see, the DOMParser failed to validate the family.xml
    file against the family dtd otherwise, it would have reported a
    validation error when it came across the
    TagToFoilParserValidation.
    Any insight as to what I'm doing wrong would be much appreciated.
    Sincerely,
    Keki
    Project Iona
    Manufacturing Applications
    Oracle Corporation
    The views and opinions expressed here are
    my own and do not reflect the views and
    opinions of Oracle Corporation
    null

    Keki Burjorjee (Oracle) (guest) wrote:
    : 2 further questions related to this issue.
    : 1) Say I am using XSLT to transform A.xml into B.xml, and I
    : want to embed a reference to B.dtd within the B.xml file. Is
    : there an XSLT command which will allow me to do this?
    : 2) Is it possible for your team to give me a mechanism whereby
    I
    : can preset the xml parser to validate the next xml file (or
    : inputstream) it receives against a particular DTD? This scheme
    : does not require the dtd to be present within the XML file
    : Thanks,
    : - Keki
    : Oracle XML Team wrote:
    : : What you are doing wrong is not including a reference to the
    : : applicable DTD in your XML document. Without it there is no
    : way
    : : that the parser knows what to validate against. Including
    the
    : : reference is the XML standard way of specifying an external
    : : DTD. Otherwise you need to embed the DTD in your XML
    Document.
    : : Oracle XML Team
    : : http://technet.oracle.com
    : : Oracle Technology Network
    : : Keki Burjorjee (guest) wrote:
    : : : Hi,
    : : : I'm trying to use an external DTD to validate an XML
    : : : file (which does not refer to this DTD). The java docs that
    : : ship
    : : : with the XML parser aren't clear on how exactly to do this
    : (or
    : : : whether it can be done). I'd appreciate any advice on how I
    : : : should perform this operation.
    : : : Here's what I'm doing right now.
    : : : 1) The Java file
    : : : import oracle.xml.parser.v2.*;
    : : : public class ParseWithExternalDTD
    : : : public static void main(String args[]) throws Exception
    : : : DOMParser dp=new DOMParser();
    : : : dp.parseDTD
    : : : ("file:d:/jdk1.2/sample/test/family.DTD","family");
    : : : DTD dtd=dp.getDoctype();
    : : : dp.setDoctype(dtd);
    : : : dp.parse("file:d:/jdk1.2/sample/test/family.xml");
    : : : System.out.println("Finished with no errors!");
    : : : 2) The family.DTD file
    : : : <!ELEMENT family (member*)>
    : : : <!ATTLIST family lastname CDATA #REQUIRED>
    : : : <!ELEMENT member (#PCDATA)>
    : : : <!ATTLIST member memberid ID #REQUIRED>
    : : : <!ATTLIST member dad IDREF #IMPLIED>
    : : : <!ATTLIST member mom IDREF #IMPLIED>
    : : : 3) The family.xml file
    : : : <?xml version="1.0" standalone="no"?>
    : : : <family lastname="Smith">
    : : : <TagToFoilParserValidation>
    : : : </TagToFoilParserValidation>
    : : : <member memberid="m1">Sarah</member>
    : : : <member memberid="m2">Bob</member>
    : : : <member memberid="m3" mom="m1" dad="m2">Joanne</member>
    : : : <member memberid="m4" mom="m1" dad="m2">Jim</member>
    : : : </family>
    : : : 4) The output
    : : : Finished with no errors!
    : : : As you can see, the DOMParser failed to validate the
    : : family.xml
    : : : file against the family dtd otherwise, it would have
    : reported
    : : a
    : : : validation error when it came across the
    : : : TagToFoilParserValidation.
    : : : Any insight as to what I'm doing wrong would be much
    : : appreciated.
    : : : Sincerely,
    : : : Keki
    : : : Project Iona
    : : : Manufacturing Applications
    : : : Oracle Corporation
    : : : The views and opinions expressed here are
    : : : my own and do not reflect the views and
    : : : opinions of Oracle Corporation
    1) No XSLT commands exist that allow you to embed a DTD while
    doing the transformation.
    2) You can use the setDocType() method in the parser, to set a
    DTD based on which the XML document will be validated. The
    parseDTD() method allows you to parse a DTD file separately and
    get a DTD object. Here is a sample code :
    DOMParser domparser = new DOMParser();
    domparser.setValidationMode(true);
    // parse the DTD file
    domparser.parseDTD(new FileReader(dtdfile));
    DTD dtd = domparser.getDocType();
    // Parse XML file - XML file will be validated based on the DTD.
    domparser.setDocType(dtd);
    domparser.parse(new FileReader(xmlfile));
    Document doc = domparser.getDocument();
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Best way to validate and xml file against a schema?

    As the subject states, I want to validate my xml file against a given schema....
    Currently my code looks like this:
    InputSource ipSource = new InputSource(new ByteArrayInputStream(bytesData)); // my xml file
    DOMParser parser = new DOMParser();
    parser.parse(ipSource);
    Document doc = parser.getDocument();
    I see that there is a setFeature method on DomParser.... but from what I read that doesnt support
    xml schema's, just DTD's. So what is the best way to validate with schema's?
    Any help would be appreciated

    This is the other way I tried doing it.... the problem with this way is I am building my xml file through DOM
    operations... and I haven't figured out how to add the schema line to the xml file through DOM manipulations.
    Has anyone done this bofore?
    try
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setNamespaceAware(false);
         factory.setValidating(true);
         InputSource ipSource = new InputSource(new ByteArrayInputStream(bytesData));
         DocumentBuilder builder = factory.newDocumentBuilder();
         doc      = builder.parse(ipSource);
         return doc;
    catch(Throwable t)
         System.out.println("parse error: " +t);
    return doc;
    }

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to Merge multiple XML  files in one file ( Env: XML Publisher 5.6.2)

    All,
    I have recently started working on XML publisher and have developed 3 reports in last 2 days using XML Publisher and integrating them with Concurrent programs.
    This is a great tool.
    I have got another requirement, where i need to use xml file generated by multiple run of same report with various parameters and then merge all xml file to a single report. Developing the whole custom process will take very long time and sure will have bugs in it. Instead i was thinking to use xml file generated by Oracle report itself.
    Report "US Gross to net summary" generates xml output in standard output directory and then show output in PDF file. I have 7 such file generated for each payroll. I want to merge output of xml into a single xml so that i can create single report having data from all 7 xml files showing me All payroll output in a single report.
    Can someone please guide me , how can i read xml file data from the output directory of a seeded concurrent program and how to manipulate data in it.
    Thanks
    Ankur

    Hi Tim,
    Thanks for replying. I have looked for "PDFBookBinder class" in xml publisher user guide for ver 5.6.2. I didn't get any reference of this text. Can you please guide me to a tutorial/link where i can get more information about this class.
    Also, i originally thought of similar to your second logic, as my design basis. Oracle process generates the xml file in output directory which i can get. What i didn't get is how do i "pick them up and merge" using publisher. Also, is there way to do this merging process using pl/sql ? Can you please give little more information on your second approach.
    My original plan of action is that i will create a report set in which i will call oracle seeded report for all 7 payrolls in a sequential manner. Then using the child requests of the report set i will get to 7 xml files generated by seeded oracle process. Then the piece i am not sure of , i will use those 7 files to generate a single xml file having payroll name as tree top for each output. Once single xml is ready, i can easily design a template and register the process to generate output as Excel.This process will not require me to actually change any data or do any calculation. It will only reformatting the feilds we see and abiity to see all 7 payroll at one time rather then entering these numbers manually into an excel to do analysis.
    Please provide your feedback, if you think above plan is not feasible or need corrections.
    Best Regards,
    Ankur

  • How to load an XML file to oracle9i server?

    I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
    Somebody help me?

    I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
    Somebody help me?

  • Does anyone know how to convert an XML file to a readable file?

    All,
    I have been using an APP called "SMS Backup & Restore" to backup my message conversations to my Laptop PC.  It works fine BUT the backup file, once in my PC, has an XML extent such as "filename.XML"
    I would like to read and/or print and/or save the text message file so does anyone know how to convert the XML file to something else so it shows all the messages without all the formatting instructions.   
    When I try to see the XML file it shows all the formatting.  If I replace the .XML with .TXT that too shows all the formatting mixed in with the text message narrative.
    When I look at the XML file in SMS Backup & Restore in the Charge phone it looks great showing all the messages just as they were on the phones display.  The problem with this is that there is no way to print or read or save the messages as they appear in the file from the phone itself.  I tried screen capture but if you have, let's say, a 28 message conversation you have to do 7 or 8 screen captures to get them all.
    If only I could convert the XML in my PC to something that is printable or savable or readable that would be the "cats meow."
    Anyone know how???
    JerryF
    PS, You might take a look at my related post.
    https://community.verizonwireless.com/message/809832#809832

    Ann154,
    You were correct again.  I deleted everything I had done to date and re-did the entire SMS backup of my 28 message conversation again and YES I was able to open it using IE-8.  It looks great and it prints great and life is good!  I am going to go make a donation.
    Thanks again for the help.  I marked this thread as answered by you.
    JerryF

  • How to create new XML file using retreived XML content by using SAX API?

    hi all,
    * How to create new XML file using retreived XML content by using SAX ?
    * I have tried my level best, but output is coming invalid format, my code is follows,
    XMLFileParser.java class :-
    import java.io.StringReader;
    import java.io.StringWriter;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMResult;
    import javax.xml.transform.sax.SAXSource;
    import javax.xml.transform.sax.SAXTransformerFactory;
    import javax.xml.transform.sax.TransformerHandler;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.xml.sax.Attributes;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.XMLFilterImpl;
    public class PdfParser extends XMLFilterImpl {
        private TransformerHandler handler;
        Document meta_data;
        private StringWriter meta_data_text = new StringWriter();
        public void startDocument() throws SAXException {
        void startValidation() throws SAXException {
            StreamResult streamResult = new StreamResult(meta_data_text);
            SAXTransformerFactory factory = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
            try
                handler = factory.newTransformerHandler();
                Transformer transformer = handler.getTransformer();
                transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                handler.setResult(streamResult);
                handler.startDocument();
            catch (TransformerConfigurationException tce)
                System.out.println("Error during the parse :"+ tce.getMessageAndLocation());
            super.startDocument();
        public void startElement(String namespaceURI, String localName,
                String qualifiedName, Attributes atts) throws SAXException {
            handler.startElement(namespaceURI, localName, qualifiedName, atts);
            super.startElement(namespaceURI, localName, qualifiedName, atts);
        public void characters(char[] text, int start, int length)
                throws SAXException {
            handler.characters(text, start, length);
            super.characters(text, start, length);
        public void endElement(String namespaceURI, String localName,
                String qualifiedName) throws SAXException {
            super.endElement("", localName, qualifiedName);
            handler.endElement("", localName, qualifiedName);
        public void endDocument() throws SAXException {
        void endValidation() throws SAXException {
            handler.endDocument();
            try {
                TransformerFactory transfactory = TransformerFactory.newInstance();
                Transformer trans = transfactory.newTransformer();
                SAXSource sax_source = new SAXSource(new InputSource(new StringReader(meta_data_text.toString())));
                DOMResult dom_result = new DOMResult();
                trans.transform(sax_source, dom_result);
                meta_data = (Document) dom_result.getNode();
                System.out.println(meta_data_text);
            catch (TransformerConfigurationException tce) {
                System.out.println("Error occurs during the parse :"+ tce.getMessageAndLocation());
            catch (TransformerException te) {
                System.out.println("Error in result transformation :"+ te.getMessageAndLocation());
    } CreateXMLFile.java class :-
    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();
    Sax.endElement("", "basic-metadata", "basic-metadata");* In CreateXMLFile.java
    class, I have retreived the xml content in the meta_data object, after that i have converted into character array and this will be sends to SAX
    * In this case , the XML file created successfully but the retreived XML content added as an text in between basic-metadata Element, that is, retreived XML content
    is not an XML type text, it just an Normal text Why that ?
    * Please help me what is the problem in my code?
    Cheers,
    JavaImran

    Sax.startDocument();
    Sax.startValidation();
    Sax.startElement("", "pdf", "pdf", new AttributesImpl());
    Sax.startElement("", "basic-metadata", "basic-metadata", new AttributesImpl());          
    String xmp_str = new String(meta_data.getByteArray(),"UTF8");
    char[] xmp_arr = xmp_str.toCharArray();
    Sax.characters(xmp_arr, 0, xmp_arr.length);
    </code><code>Sax.endElement("", "basic-metadata", "basic-metadata");</code>
    <code class="jive-code jive-java">Sax.endElement("", "pdf", "pdf");
    Sax.endValidation();
    Sax.endDocument();     
    * I HAVE CHANGED MY AS PER YOUR SUGGESTION, NOW SAME RESULT HAS COMING.
    * I AM NOT ABLE TO GET THE EXACT OUTPUT.,WHY THAT ?
    Thanks,
    JavaImran{code}

  • How to transfer an xml file to NW Portal Knowledge Management from XI?

    Hi all,
    Anybody knows how to transfer an xml file to NW Portal Knowledge Management from XI?
    What kind of adapter type I have to choose? And which procedures I have to do in KM Portal? Create a folder, what kind of folder and permissions?
    Suggestions and ideas are appreciated.
    Thanks in advance,
    Ricardo.

    Hi
    Can anyone tell me how XI sends messages to applications like J2EE. In REceiver comm channel, I think we specify about the target system like J2EE appl.
    Aadapter Type: HTTP
                   Receiver
    Transport Protocol:  HTTP1.0
    Message Protocol:    XI payload in HTTP body
    Adapter Engine:      Integration Server
    Addressing Type:     URL address
    Target host:         localhost
    Service Number:      7001(Port number of Weblogic appl server--where my J2EE appl is deployed).
    Path     :  /Invoke/DisplayRes/
    Authentication Type:Use Logon Data for SAP System
    Content Type: text/xml
    Username:   xiappluser
    password:   xx
    XML code:   UTF-8
    I suppose XI sends msgs to http://localhost:7001/Invoke/DisplayRes/........
    in this example if am correct?
    Then I have given all tyhe necessary setting but my servlet is not able to display XML msg in browser?
    This is my servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         PrintWriter out = response.getWriter();
         BufferedReader brin =new BufferedReader(new InputStreamReader(request.getInputStream()));
         String inputLine;
         StringBuffer sBuf = new StringBuffer();
            response.setContentType("text/xml");
         while ((inputLine = brin.readLine()) != null)
             sBuf.append(inputLine);
             out.println("hi");            
                out.println(sBuf.toString());
             brin.close();
             out.flush();
    What went wrong?
    Help me, all helpful answers are highly rewarded.
    Thanks

  • How to transfer a xml file?

    Dear friends,
    I have a question about how to transfer a xml file between server and client using axis or weblogic.
    My application needs to send xml files instead of primitive data types and bean objects.
    Is it possible to tranfer files between server and client?
    thank you very much for your great help!
    jayanandan.

    hi,
    There are two ways in which u can send an xml file.
    1) U send it along with the body of the soap message.
    2)u can send it as an attachment in the soap envelope. this method u can use for any type of files.
    If u send it in soap body the it will take more time for the processing of the soap body.so attachment is the best way.
    I case of any queries please feel free to post it in the forum
    Regards
    Sandy

  • How to get the XML file if we are using the Product short name.

    Hi,
    Till now I have used Short name of the Concurrent Program for Code while creating a Data Definition. Now saw a seeded template which has given the Code by Product short name. If we have the concurrent program then it is easy to refer the fields by checking the XML file. In this case how to find the XML file or how to refer all the fields if we have given code with Product short name. I saw this for iReceivables(ARI). Anybody please help me.
    Thanks.

    Hi Siva
    Just to clarify, rather than the short name of the conc program there is a shipped data definition that just uses the product short name? What is the data def so I can check it.
    Regards, Tim

Maybe you are looking for