XSD validation in ABAP

Hi folks.
Is it possible to validate a message using a XSD (in XI) using ABAP Classes / functions instead of JAVA (and BPM)? Like mandatory fields, field types, etc etc
Thanks in advance.
Best regards.
Valter Oliveira.

hey valter,
you can do that in any language you want.
The point is that you already have delivered java APIs for xsd validation (actually, xsd validation is performed as standard by compliant SAX/DOM parsers).
For ABAP, you'd probably need to develop this API from scratch.
The advantage of Java is not its speed or resource-consuming: it is just that everything is already developed on Java. lol
Regards,
Henrique.

Similar Messages

  • XSD VALIDATION IN ABAP PROGRAM

    Hi,
    I have a requirement where in a report i am picking xml file from the presentation server (desktop) and then i am parsing the xml file using FM "SMUM_XML_PARSE" (first i use FM SCMS_BINARY_TO_XSTRING and then SMUM_XML_PARSE). after using the function SMUM_XML_PARSE i get the xml data in my internal table and then my report uses that data for some processing. This all is working fine .
    My issue is that how do i do a XSD VALIDATION for the xml file that i am reading . I would have liked to do a xsd validation after i import the xml file and throw error if the xml file is not as per its xsd.As i am not using any middleware technology like XI/ WTX which have XSD validation functionality i am not sure how to achieve this in abap program.

    Hi,
    I think you're right, iXML can only validate DTD via its if_ixml_parser->set_validating method (you can find this information in SAP SDN article "ABAP XML Mapping", as of release 6.10, I couldn't find any other reference saying that xsi:noNamespaceSchemaLocation is supported since then).
    By looking at SDN, I saw an external link about XSD to DTD conversion via XSLT (http://crism.maden.org/consulting/pub/xsl/xsd2dtd.xsl), but I don't have any idea if it works. On another thread, people used OS command to do XML/XSD validation, but didn't describe what they ran exactly (anyway, that means using any external tool).
    Sandra

  • XSD Validation with ABAP XML Parser?

    Hello there,
    i'm loading xml files into a R/3 System. This all works fine with the standard XML Parser.
    The XML Files are based on a .xsd structure that is assigned to each file with a external link.
    To be sure that the xml document conforms to this .xsd structure i would like to check against it.
    For that i would like to hold a .xsd structure string in my abap programm.
    How can this be accomplished? Is this possible anyway?
    Greetings and many thanks.
    Kay

    check out the class
    CL_XML_SCHEMA
    Regards
    Raja

  • XML validation against XSD Schema in ABAP

    Hi colleagues,
    I'm looking for a way to validate a XML against a XSD schema in ABAP, without using java or command line or something like that. Is there any way to do this only with ABAP?
    Thanks in advance.
    Regards,
    Guenter

    Hi everyone,
    I'm currently facing the same problem. I need to validate a xml file with an existing xsd schema for some export/import functionality. I just found an ABAP program doing this with a Java fallback. But isn't there a way doing this wihtout using Java but only ABAP? There certainly is, anyone an idea?
    Thank you and regards
    Maximilian

  • Validate a XML file with a XSD File in ABAP

    Hi everybody,
    I am searching a way for validating a XML File with an external XSD File in ABAP. I know to validate with dtd is possible, but what about XSD?
    Can you help me in my urgend problem ?
    Greetings from Germany
    ismail er

    anyone an idea for my issue ???

  • FTP Adapter XSD Validation

    Hi All,
    Oracle InterConnect 10.1.2
    Oracle Adapters (AQ,FTP) using XSD
    FTP Adapter on local filesystem
    In the FTP Adapter, Is there anyway to validate the XML content against the XSD?
    The validation is happening at the common view when i use the "Validate XML" check box while creating the event in iStudio. However this option does not appear while configuring the FTP adapter in iStudio. I would like FTP adapter to reject the XML file if the XSD validation fails and move the file to the exception folder.
    Objective: XSD should perform datatype, datasize and format validations.
    Thanks,
    Sherry

    Can anyone let me know how to enforce the XSD validation in the adapter. As of now only the structure of the message is being checked.

  • Can SOA 11g fault policy handle XSD Validation errors from the Mediator?

    I would like all errors in my SOA process to go through the fault-policies.xml. But I don't seem to be able to catch any mediator error caused by an XSD validation failure. A sample of the sort of error I am trying to 'catch' is:
    Nonrecoverable System Fault          oracle.tip.mediator.infra.exception.MediatorException: ORAMED-01303:[Payload default schema validation error]XSD schema validation fails with error Invalid text 'A' in element: 'TermCode'Possible Fix:Fix payload and resubmit.
    My fault-policies.xml file is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">
    <faultPolicy version="2.0.1"
         id="NewStudentRegistrationFaults"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.oracle.com/bpel/faultpolicy"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Conditions>
    <faultName xmlns:medns="http://schemas.oracle.com/mediator/faults" name="medns:1303">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    <faultName xmlns:rjm="http://schemas.oracle.com/sca/rejectedmessages" name="rjm:GetNewStudentRegistrationFile">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    <faultName xmlns:medns="http://schemas.oracle.com/mediator/faults" name="medns:TYPE_ALL">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:mediatorException">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:bindingFault">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:remoteFault">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    </Conditions>
    <Actions>
    <Action id="java-fault-handler">
    <javaAction className="edu.villanova.soa.handlers.FaultNotificationHandler"
    defaultAction="ora-human-intervention" propertySet="faultNotificationProps">
    <returnValue value="OK" ref="ora-human-intervention"/>
    </javaAction>
    </Action>
    <!-- Human Intervention -->
    <Action id="ora-human-intervention">
    <humanIntervention/>
    </Action>
    <!-- Terminate -->
    <Action id="ora-terminate">
    <abort/>
    </Action>
    </Actions>
    <!-- Property sets used by custom Java actions -->
    <Properties>
    <!-- Property set for FaultNotificationHandler customer java action -->
    <propertySet name="faultNotificationProps">
    <property name="from">[email protected]</property>
    <property name="to">[email protected]</property>
    <property name="subject">Reporting a SOA fault</property>
    </propertySet>
    </Properties>
    </faultPolicy>
    <faultPolicy version="2.0.1"
         id="MediatorFaults"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.oracle.com/bpel/faultpolicy"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Conditions>
    <faultName xmlns:medns="http://schemas.oracle.com/mediator/faults" name="medns:1303">
    <condition>
    <action ref="java-fault-handler"/>
    </condition>
    </faultName>
    </Conditions>
    <Actions>
    <Action id="java-fault-handler">
    <javaAction className="edu.villanova.soa.handlers.FaultNotificationHandler"
    defaultAction="ora-human-intervention" propertySet="faultNotificationProps">
    <returnValue value="OK" ref="ora-human-intervention"/>
    </javaAction>
    </Action>
    <!-- Human Intervention -->
    <Action id="ora-human-intervention">
    <humanIntervention/>
    </Action>
    <!-- Terminate -->
    <Action id="ora-terminate">
    <abort/>
    </Action>
    </Actions>
    <!-- Property sets used by custom Java actions -->
    <Properties>
    <!-- Property set for FaultNotificationHandler customer java action -->
    <propertySet name="faultNotificationProps">
    <property name="from">[email protected]</property>
    <property name="to">[email protected]</property>
    <property name="subject">Reporting a SOA rejected msg. fault</property>
    </propertySet>
    </Properties>
    </faultPolicy>
    </faultPolicies>
    My fault-bindings.xml file is as follows:
    <?xml version="1.0" encoding="UTF-8" ?>
    <faultPolicyBindings version="2.0.1"
    xmlns="http://schemas.oracle.com/bpel/faultpolicy"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <composite faultPolicy="NewStudentRegistrationFaults"/>
    <component faultPolicy="MediatorFaults">
    <name>NewStudentRegistrationMediator</name>
    </component>
    <service faultPolicy="NewStudentRegistrationFaults">
    <name>GetNewStudentRegistrationFile</name>
    </service>
    </faultPolicyBindings>
    You'll notice that I've tried a number of ways (and various other combinations) to try to steer the error above into my Java fault handler but nothing has meet with success. The mplan is as follows:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <!--Generated by Oracle SOA Modeler version 1.0 at [2/3/10 1:21 PM].-->
    <Mediator name="NewStudentRegistationMediator" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/sca/1.0/mediator"
    wsdlTargetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/Experiments/NewStudentRegistration/GetNewStudentRegistrationFile%2F">
    <operation name="Get" deliveryPolicy="AllOrNothing" priority="4"
    validateSchema="true">
    <switch>
    <case executionType="queued" name="RegToBanner.insert_2">
    <action>
    <transform>
    <part name="$out.NewstudentregistrationCollection"
    function="xslt(xsl/NewStudentRegistration_To_NewstudentregistrationCollection.xsl, $in.body)"/>
    </transform>
    <invoke reference="RegToBanner" operation="insert"/>
    </action>
    </case>
    </switch>
    </operation>
    </Mediator>
    I'm a newbie to Oracle SOA. So perhaps I am missing the obvious. But I haven't read much in the documentation specifically about using the XSD validation option on the mediator and have seen nothing specifically about catching this sort of exception in the fault policy (apart from the faults I already have in my policy). Can anyone suggest what I am doing incorrectly here or perhaps whether what I am attempting to do is not possible? Thanks.
    - Cris

    Has anyone got it working yet?
    In my case, I have the following sequence:
    FileAdapter -> Mediator1 -> Mediator2->DB Adapter
    I am deliberately introducing validation error in File. Isn't it correct to assume Fault framework would get triggered at Mediator1 level since we are invoking FileAdapter service?
    I am getting a strange behaviour. If I enable XSD validation at Mediator1 level, process is Faulted with no re-try option. However, if I enable XSD validation ONLY at Mediator2 level, I get Recoverable fault. There seems to be some disconnect between documentation and reality. I am using JDeveloper 11.1.1.3.0 version and SOA Suite 11g.
    Thanks,
    Amjad.

  • Attributes missing after XSD validation!

    I'm feeding a very simple XML file into an equally simple XSD validator. When it returns, all of my tags are fine, but the attributes are dropped. If I parse the file directly, without validation, the attributes are fine.
    I've posted my files online at http://www.pastie.org/507569
    Am I doing something wrong here? Is this a bug in my JRE (1.6.0r14)?
    Thanks for any help,
    Norman

    XML
    <config blah="5">hello!</config>
    XSD
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
         <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />
      <xs:element name="config">
       <xs:complexType>
        <xs:simpleContent>
         <xs:extension base="xs:string">
          <xs:attribute name="blah" type="xs:string"/>
         </xs:extension>
        </xs:simpleContent>
       </xs:complexType>
      </xs:element>
    </xs:schema>
    My code...
    SchemaFactory schema_factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = schema_factory.newSchema(new File("test.xsd"));
    StreamSource xml_source = new StreamSource(new File("test.xml"));
    StringWriter xml_bridge = new StringWriter();
    StreamResult xml_result = new StreamResult(xml_bridge);
    Validator validator = schema.newValidator();
    validator.validate(xml_source, xml_result);
    System.out.println("Validated to: " + xml_bridge.toString());
    Result...
    Validated to: <?xml version="1.0" encoding="UTF-8"?><config>hello!</config>

  • XSD validation for incoming data into BPEL process

    Please suggest how to validate XSD incoming data into BPEL process.
    I just wanted to verify the data before entering into BPEL

    Hi,
    I guess i am replying very late.
    In BPEL 2.0 we have an activity called "Validate" which can do the XSD validations.
    "Lets Learn Oracle SOA: Validate XML schema In BPEL"
    Regards,
    Chinmaya

  • XSD VALIDATION

    Hi,
    I have generated the DOM TREE and this dom tree need to pass through XSD Validate and then the generated (XML) is to go through the XSLT processor.
    I need your suggestion how to go with after generating the DOM TREE.
    Thanks.

    Nice find, Ben. Thanks.
    I've been using jUnit with the XML and XSD support in Java 5. Here's a link, if anyone is looking for a way to do XSD validation from within a Java program:
    http://itunesu-api-java.googlecode.com/svn/branches/xsd-validation/src/test/edu/ asu/itunesu/XsdTest.java
    Dave

  • XSD validation with multiple namespaces

    Hi All,
    I'm trying to validate some XML using an XSD that contains multiple namespace schema descriptions, as such, the main XSD file must import an XSD for each namespace.
    The difficulty is that I cannot seem to find a way (in Oracle) to run a XSD validation using this (multi-XSD file) method.
    Has anyone out there tackled a similar problem?
    Cheers,
    Ben

    check out the class
    CL_XML_SCHEMA
    Regards
    Raja

  • XSd-validation isn't performed when invoking file Adapter

    I've configured an ESB where data needs to be transformed using a file adapter and a db adapter.
    The deleimted files first need to be validated using xsd (native transformation) and if validation was performed correctly they can be transformed and loaded into db tables.
    The xsd-validation isn't performed in my use case where some fields are required, have a decimal-format etc., if the files don't comply they're still picked up and being transformed to the db adapter, where the insertion will fail then because the file had errored records in it.
    I'm using esb 10.1.3.3 in this case.
    kind regards,
    Nathalie

    Hi Nathalie,
    I'm not able to define properties on my esb routing
    service in release 10.1.3.3, the definition tab isn't
    showing any detailed information for my routing
    service.Strange, we're also using 10.1.3.3. Make sure in the ESB Control when you select the routing service, that the operation for which you want to validate the payload is selected. If it is selected, the operation details section should show the validation option. Also see page 3-14 of the ESB Developers Guide. You can also change the esbsv-file:
    <operations>
    <operationInfo guid="xyz" qname="Test.Insert.insert" wsdlOperation="insert" mepDisplayName="One Way" mep="OneWay">
    <request validate="true" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/d
    b/top/Insert" element="tns:TestCollection"/>
    </operationInfo>
    </operations>
    </service>
    using the validate="true" option.
    No logging is being generated for this matter, so I'm
    not sure which problem I'm facing wright now. I will
    bounce the service and try again.We had such an issue when we didn't validate payload at runtime and inserted data using DB adapter. Our TopLink mappings didn't correspond to the XML data to be inserted. That caused only 2 tables out of 4 to be updated, without any error logged. Enabling validation, resulted in an error being thrown; the behaviour we wanted.
    The only thing that's of importance here, is that I
    need to define this functionality within BPEL and not
    ESB, the customer has only acquired bpel for this
    matter because human task integration was necessary.One of the advantages of 11g fortuntely is that separation of concerns will be better. It will be much clearer where to use adapters. Not that this helps in your current case right now :-s
    I should be able to accomplish the xsd validation
    inside a bpel configuration.That should work, good luck!
    Regards, Ronald

  • Xsd validation in Database for 1 million record

    Hello All,
    I would like to know the pros and cons to do the xsd validation of a million record in 11g database and if possible the processing time taken to do xsd validation for million records.
    What would be good datatype to load this xml file of million records, should it be blog/clob or varchar2(200000000).
    Thanks.

    varchar2(200000000).SQL VARCHAR2 is limited to 4000
    PL/SQL VARCHAR2 is limited to 32767

  • Urgent Requirement : XSD Validation for internal references

    Hi,
    I have a requirement , according to which....i have
    Invoice Date and Contract Date and XSD validations on these two fields are dependent.
    i.e, invoice date is required if contract date is absent .
    Contract date is required if invoice date is absent.
    How can we validate the xml file with this scenario using XSD.
    Thanks for the help....in advance.
    Regards,
    Aru

    Hi,
    The solution to the problem u gave works fine but validates like AND condition not OR.........
    Any other answers..........Thanks for ur reply......
    Aru

  • Why XSD Validation Is used and How

    Hi All
    Please explaim why we use XSD validation and how it is done.
    Regar

    Hi Nidhi,
    >>I still did not unserstand that what is the purpose of using XSD vilidation for sender soap scenario.
    May be you shoudl have written this in the first place that you need to know why XSD validation for SOAP sender scenarios
    Now have you created a SOAP scenario in PI and have given the wsdl to some external client? If yes then you may not be required to use the XSD validation option, because you have given the source structure used in PI in the wsdl file itself.
    Now think like you have not provided the wsdl file and  the source side is manually creating the XML that need to be sent to PI. there are chances that the mandatory fields may be missed or some other mismatch in structure can happen. If you don't go for XSD validation in source side there are chances that you message mapping may fail. So to avoid this you can use the XSD Validation, where you are validating the XML structure (which is sent to PI) with XSD schema (which is used in PI) amd if any mismatch found then it can fail before mapping
    Regards
    Suraj

Maybe you are looking for