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?

Similar Messages

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

  • How to validate inserted xml data in oracle is correct or not

    (i.e.how to validate xml syntax and tags are correct)
    XML data has been inserted in Oracle database.Once inserted
    I want to validate that data entered and tags inserted are correct
    or not.
    Pl help

    Some small remarks after a life time of write that small notepad.
    Don't use XMLIsValid() - Apperently it was once ment for use in table constraints only AND the most annoying part, it doesn't give you a proper error message.
    More usable is schemaValidate() - it throws a useful error message... I never came around to update that post or write a proper one while using schemaValidate().
    I would be against advising / using a Java wrapper to achieve this goal unless you are on a pre 9.2 database version. Registering, validation and such is optimized (in memory) in Oracle from the beginning in 9.2.0.3 and onwards to avoid for instance reparsing of the XML Schema itself. If a XML Schema is registered a lot is optimized including DOM, which will be avoided and "outsmarted" by using XOB objects (see the Oracle manuals only a few hits and those will point you directly to the optimizations at hand).

  • Not able to validate the xml document against DTD using SAX

    Hi ,
    i am not able to validate xml document against its DTD using SAX parser even after setting setValidating = true. even if the file is not correct according to DTD , it is not throwing any exception. what could be the reason.? please help..
    kranthi
    this is the code sample i used.
    SAXParserFactory factory = SAXParserFactory.newInstance();
    factory.setValidating(true);
         try {
    factory.newSAXParser().parse(new File("sample.xml"), handler);
         } catch (SAXException e) {
         e.printStackTrace();                         System.exit(2);
         } catch (ParserConfigurationException e) {
    e.printStackTrace();
    }

    Hi karthik
    Thanks for your response
    Actually iam a beginner in java coding hence struggling to come up with the things
    I tried putting your code and onserver side i see it is returning 09:12:17,234 INFO [STDOUT] [root: null]
    actually the same program i wrote in java
    and the same method i was calling from the main
    and it is working fine and the xml document is getting displayed one important thing to be noted here is that the factory.newDocumentBuilder().parse(new File(filename));is returing XmlDocument
    and the printing takes place
    but the in same method public static Document parseXMLFile(String filename, boolean b) in servlet
    the line factory.newDocumentBuilder().parse(new File(filename)); is returning DeferredDocumentImpl
    and this creating problem , had it returned XmlDocument
    i would have printed the elements one one
    but as it is returning deferredimpl
    iam unable to print the elements
    could you please tell me why factory.newDocumentBuilder().parse(new File(filename)); is returning DeferredDocumentImpl
    in servlets but in plain java pogram it is returing XmlDocument
    Thanks
    Bhanu

  • How to get the XML Payload of called process from calling process?

    I have two SOA processes say process A and process B.
    Process B is called by process A.In process A I, am using the getRequestMessage() method in Java code to get the XML payload of process A.
    But i want the XML payload of process B in process A.How can i achieve it?

    Doug,
              I used the property loader method but I could not load the limits of any sub sequence call calling an external sequence file.
    I took the FlowRate_test.seq example from the NI Example folder "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI". I created a sequence called PumpTest.seq in the same folder path. I then moved the Pump Test step from the FlowRate_test.seq to the PumpTest.seq. Now created a sequence call in the FlowRate_test.seq and called the PumpTest.Seq as the module path. When I execute the FlowRate_test.seq , I get the error as shown below:
    Attached is the Flowrate_Test.seq and the PumpTest.seq which should be there in the folder path "C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2.1\Examples\PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI".
    Let me know whether I am doing something wrong in this method. 
    My idea is to alter the runstate variable High and Low of Pump Test in the PumpTest.seq and then run the Flowrate_Test.seq.
    Attachments:
    PumpTest.seq ‏6 KB
    FlowRate_test.seq ‏11 KB

  • 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 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 remove a node from a target xml payload in reciever file channel

    i have a scenario where i have to remove a node from my target xml file in receiver file channel and want xml as the output file. I don't want a fixed length file. How to do that in receiver channel? Do we need to use file content conversion for that?

    that will result in giving you a fixed file or a separator defined file.
    it will not give you an XML file.
    In case you want a XML file, instead of using variable substitution, use Dynamic configuration and adapter specific properties.
    Some ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

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

  • Reading XML payload from text file

    Hello,
    I have a text file with XML payload in it. The text file has some header information and then the XML payload. How do I read only the XML payload for processing in PI?
    the structure of the text file is something like this..
    Header Information
    Payload
    Sample:
    #Datetime: 20140318-09:28:50.129
    #MessageID: sample123
    #Sender: TEST
    #SenderParty: TEST
    #ReceiverService:
    #ReceiverParty: Test
    #Interface: Test123
    #InterfaceNamespace: http://test.com
    <?xml version="1.0" encoding="UTF-8"?>
    <Sample ><Header>......
    Please advise.
    Thank you.
    Larry.

    package com.learning.utils;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class FetchPayload extends AbstractTransformation {
      String strData = null;
      @Override
      public void transform(TransformationInput arg0, TransformationOutput arg1)
      throws StreamTransformationException {
      // TODO Auto-generated method stub
      getTrace().addInfo("File Reading started ");
      String strData = convertStreamToString(arg0.getInputPayload()
      .getInputStream());
      getTrace().addInfo("File Reading successfully completed ");
      try {
      getTrace().addInfo("Generating XML started");
      strData.substring(strData.indexOf("<?xml"), strData.length());
      arg1.getOutputPayload().getOutputStream().write(
      strData.getBytes("UTF-8"));
      getTrace().addInfo("Generating XML started");
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      public String convertStreamToString(InputStream in) {
      StringBuffer sb = new StringBuffer();
      try {
      InputStreamReader isr = new InputStreamReader(in);
      Reader reader = new BufferedReader(isr);
      int ch;
      while ((ch = in.read()) > -1) {
      sb.append((char) ch);
      reader.close();
      } catch (Exception exception) {
      return sb.toString();
    and u can get  the xml as a resultant which  u can use as input for next message mapping.
    thanks and regards,
    Praveen T

  • How to submit pdf xml data to a file server

    Hi, I am hoping someone can help me. I have created a dynamic pdf in livecycle designer ES, which appears as the requester wants it to. I now just need to work out how to collect the submitted data. Is it possible to submit the xml data to a file server? I have succeeded in emailing the data, but each response is separate xml attachment and would then need to collated, etc. It would be preferable to submit the data directly to a file server if this is possible. Even if it submitted into a database or something. From everything I have read so far, it seems that this is not possible, unless I am missing something. As a newbie to this, any assistance would be much appreciated. Thank you.

    You can submit the data as XML or URL-encoded data (HTTP POST). In either case you will need to have a server-side process to receive and parse the data stream. The server-side process may be a JSP, a servlet, PHP or any technology that can manage HTTP requests/responses.
    See About submitting data using a button at http://help.adobe.com/en_US/livecycle/9.0/designerHelp/000330.html .
    Steve

  • How to create an xml to load swf files in sequence?

    hello everyone
    I'm new in web design... I know how to animate in flash, using timeline, frames, layers, twins and so on... But I want to move forward so I want to create a xml to load swf files in sequence and in loop. Each swf file has 8 seconds.You can see the example here in www.cm-seixal.pt.
    I'm not a programmer but I understand how actionscript works... I hope you can help me
    Cheers!
    Ana

    you can use the urlloader class to load your xml file.  use the loader's complete event and the loader's data property to retrieve the data in your xml file.

  • How to write non-XML data to a file using an OSB FTP Routing?

    Hi --
    Situation ... I need to write non-XML data to a file using FTP. A proxy service retrieves XML and transforms it with XSLT to CSV format, then gives it to a Biz service to file it out, using FTP. Simple.
    Problem ... OSB sends the contents of $body to any service it calls. Because $body is a SOAP document, it has to contain XML. So therefore I have to put my CSV data into an XML element, in order to put it into $body; and this inner element then gets written to the file, which I don’t want. But if I don't enclose my CSV content in a tag, I get "Unexpected CDATA encountered" trying to assign it to a variable.
    There has to be away around this!
    Thanks for your help.
    John Taylor

    Solved. Steps:
    -- Transform the XML to CSV using an XSL transform. Put the CSV data inside enclosing XML elements, and use a Replace action to put the XML element + CSV contents back into *$body*.
    -- Define an MFL transform that only knows about the enclosing XML elements. Use a delimiter of "\n" (hard return).
    -- Route from the proxy service to a Biz service that has Service Type = Messaging Service and Request Message Type = MFL; specify the MFL transform, which will receive the incoming *$body* variable, strip off the enclosing XML element within it, and pass the CSV contents to the FTP service.
    Edited by: DunedainRanger on Nov 29, 2011 9:03 AM

  • How to validate generated XML-Document in Memory by XML-Schema?

    Hi all!
    I have the following problem:
    I am generating a Document using the DOM delivered with Xerces 2.6.2.
    Before I'll send the generated xml-document through network to another system I have to check with my xml-schema if the document is correct.
    In the DOM-FAQ I found an "example" trying to explain how it should work. But with this example the problems begin.
    I am creating my document with this method:
         public void createDocument() {
              myDOM = DOMImplementationImpl.getDOMImplementation();
              doc = myDOM.createDocument("", "documentData", null);
              root = doc.getDocumentElement();
              root.setAttribute(
                   "xmlns:xsi",
                   "http://www.w3.org/2001/XMLSchema-instance");
              //          root.setAttribute("xsi:noNamespaceSchemaLocation", "myScheme.xsd");
              domConfig = ((DocumentImpl) doc).getDomConfig();
              domConfig.setParameter(
                   "schema-location",
                   "file:///d:/workspace/XMLProject/WebContent/WEB-INF/myScheme.xsd");
              domConfig.setParameter("error-handler", new EHandler());
              domConfig.setParameter("validate", Boolean.TRUE);
         }In the line getting the domConfig, it is getting differeing to the example: The example is like this:
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMConfiguration;
    import org.w3c.dom.ls.LSParser;
    Document document = builder.parseURI("data/personal-schema.xml");
    DOMConfiguration config = document.getConfig();
    config.setParameter("error-handler",new MyErrorHandler());
    config.setParameter("validate", Boolean.TRUE);
    document.normalizeDocument();They get the DOM-Configuration from the document-Object, but my document-Object has no "getConfig()" and only after type-casting I get a getDomConfig()-Method to get the configuration.
    Then I fill my document and call                
    ((DocumentImpl) doc).normalizeDocument();When I run my Application I get the following error:
    org.w3c.dom.DOMException: FEATURE_NOT_SUPPORTED: The parameter schema-location is recognized but the requested value cannot be set.
         at org.apache.xerces.dom.DOMConfigurationImpl.setParameter(Unknown Source)
         at xmlProject.createDocument(Convert.java:63)
         at xmlProject.Convert.main(Convert.java:154)I tried several ways to get the validation without success.
    The next question is how I should refer to my xml-schema (which path) and where to place it relative to my jar I will generate, because I will have no webserver I could place it on.
    Has anyone any experience with validating a document created and not placed on disc?
    I have also another question to SAX: I read, that it is reading a document without saving it in the memory. I think this means that if I am validating it by SAX it will be read once and for parsing it will be read a second time. If I would transfer the document over an tcp-connection, I only have the document once in my inputstream and after validation it would be consumed I think. But what can I parse then? Or did I missed a detail with the function of the SAX?
    Thank you for your help!
    Yours
    Christian

    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 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));

Maybe you are looking for

  • Help with iFolder3 and OS X 10.9.2

    I have just upgraded the OS on my imac to 10.9.2 and this has brought my ifolder3 function to a halt - tried to reinstall but it will not run and I have no access to my iFOLDERS - any help much appreciated

  • Date-Time stamp on CQ published pages

    Hello, How do I display last-published-date-time stamp for published CQ pages. This is critical to customers, as the date-time stamp determines the relevance of articles. Thanks, Suhas Yogin

  • Weblogic.ejbc compiler

    Hi, i've a problem with the boot of the entity beans. My entity beans extends a class in which there is a definition of a public variable Long which there isn't defined in the bean but it is in the ejb-jar.xml as cmp-field and in the weblogic-ejb-ext

  • Can't get speed editor working

    i am using imovie 10.0.2, (newly updated version) and struggling to select the speed editor. I have right clicked the video clip which reveals the drop down menu the speed editor is in but it is the only selection not available. Dont know what i am d

  • Thinking about moving to Logic Studio

    I am seriously thinking about making the move to Logic having watched all the online videos. LOOOVE those new amps!!!! I am pretty good now with Garageband, but think I am ready for more. So my question is has anyone tried to go to Logic? If you did