Ignore DTD declaration in incoming XML message

Hi,
I have an issue where I am receiving an incoming XML message which starts with a DTD declaration.
This causes an issue with the XML parser step in the mapping because the parser attempts to resolve the DTD location. However this location is external and the PI server cannot access it.
The location for reference is http://dtd.bibit.com/paymentService_v1.dtd
Therefore I am investigating options to ignore the DTD declaration or removing it altogether prior to the XML parser step.
I would hope I could use either XSLT or Java mapping but do not really know where to start.
Can anyone please provide a method of doing this ? I would prefer to use XSLT but am open to other options.
I have no control over the DTD declaration as it is supplied by a 3rd party application. 
Thanks
Colin.

Hi Russell,
The XSLT sample you have provided does not work.
I still get the message below in the trace file:
<Trace level="2" type="T">Call XSLT processor with stylsheet BIBIT_PaymentResponse.xsl.</Trace>
  <Trace level="2" type="T">resolveEntity systemId = 'http://dtd.bibit.com/paymentService_v1.dtd' (publicId = '-//Bibit//DTD Bibit PaymentService v1//EN').</Trace>
  <Trace level="3" type="T">Search http://dtd.bibit.com/paymentService_v1.dtd (urn:com-dg-ng:crm:paycardauth, -1) in swcv 703fadc0-858c-11dd-971b-f2400a20801e.</Trace>
  <Trace level="3" type="T">Search http://dtd.bibit.com/paymentService_v1.dtd (-1) in swcv 703fadc0-858c-11dd-971b-f2400a20801e without namespace.</Trace>
  <Trace level="1" type="T">Resource not found: http://dtd.bibit.com/paymentService_v1.dtd Thrown: com.sap.aii.ib.server.mapping.execution.MappingClassNotFoundException: http://dtd.bibit.com/paymentService_v1.dtd at com.sap.aii.ib.server.mapping.execution.InternalMappingFinder.getInputStream(InternalMappingFinder.java:119) at com.sap.aii.ib.server.mapping.execution.InternalMappingFinder.readFile(InternalMappingFinder.java:62) at com.sap.aii.ib.server.mapping.execution.MappingLoader.getResourceAsStream(MappingLoader.java:131) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer$MappingEntityResolver.resolveEntity(AbstractMappingTransformer.java:328) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1272) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2804) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2839) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:160) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:261) at com.sap.engine.lib.xml.parser.Parser.parse_DTDValidation(Parser.java:282) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:293) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:126) at com.sap.aii.ib.server.mapping.execution.jaxpfactories.MappingXMLReader.parse(MappingXMLReader.java:102) at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:387) at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240) at com.sap.aii.ib.server.mapping.execution.AbstractMappingTransformer.transform(AbstractMappingTransformer.java:174) at com.sap.aii.ib.server.mapping.execution.XSLTMapping.executeStep(XSLTMapping.java:79) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.SequenceMapping.executeStep(SequenceMapping.java:40) at com.sap.aii.ib.server.mapping.execution.Mapping.execute(Mapping.java:60) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:87) at com.sap.aii.ib.server.mapping.execution.MappingHandler.map(MappingHandler.java:71) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:119) at com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:72) at com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:79) at sun.reflect.GeneratedMethodAccessor310.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:43) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy544.processFunction(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:183) at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:269) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:152) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247)</Trace>
I will try your Java mapping next and get back to you if I get success with this.
Cheers for your help.
Colin.

Similar Messages

  • Sort incoming XML message

    Hi
    Is there a standard way in PI to sort the incoming XML message within the message mapping before doing the mapping itself?
    The scenario would be an incoming Flat file with header and item data records, and we will be mapping it in PI to create IDOC messages based on the same Header segment. So for the same Header Data I would like to create a single IDOC. But the incoming file would be unsorted, so I would need to sort it first based on the header segment some way.
    Ideally, we would like to do all of the mapping in the graphical mapping tool and not use a UDF.
    Thanks
    Edited by: MxG on Nov 20, 2008 5:04 PM

    I already tried Sort, but it doesnt work the way I want.
    Say I have inbound XML as
    <hdr1>
    <hdr2>
    <itm1>
    <itm2>
    <itm3>
    it needs to be mapped to an IDOC as
    <hdrsegment>
    <itmsegment>
    I mapped XML header data to IDOC after sorting, and that works fine. The issue comes on assigning the inbound XML Item data to IDOC Item segment. It is creating the correct Number of segments, but when assiging the fields to IDOC fields, it is using unsorted data ie the data as received, not the sorted one which I did for IDOC Node, and for Header fields.
    What I really want is to sort the data once, and then use that in the mapping.

  • What table stores incoming XML message

    Hi Gurus,
    Can anyone tell me which is the table where the XML of incoming messages are stored in integration broker. I am aware of the tables like PSAPMSGSUBCON,etc mainly give only the status and other information about the message; but I am interested in knowing where exactly is the actual XML stored in the database.
    -Sudripta

    OK. I did some testing with the data in PSAPMSGPUBDATA. Base64 is not involved anywhere. I did this against PT 8.50. I think PT 8.48 to PT 8.50 (the current version) would be the same. I looked at some code I wrote for PT 8.45 and it was very similar. The table and fields were different, but the compression, etc was the same.
    It appears that the data in the MIMEDATALONG field is compressed only (no base64, etc). I don't know the compression algorithm used. I used the java.util.zip.Inflater class to "inflate" the contents.
    About concatenating the "pieces"... I didn't have any large enough messages to see data chunking. From my testing, I saw that SUBSEGMENTNO of 0 contained the JMS header and IBInfo. SUBSEGMENTN0 of 1 had the XML message. It seems that the DATASEQNO field would contain an index for chunked data, but I didn't have any messages large enough to verify. For each SUBSEGMENTNO, I inflated them separately, not concatenated. I don't know if chunked data is zipped and then chunked, or chunked and then zipped. This will determine whether you concatenate data and then inflate or inflate and then concatenate.
    Here is my test code:
    import java.io.UnsupportedEncodingException;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.zip.DataFormatException;
    import java.util.zip.Inflater;
    public class MessageDownloader {
      public MessageDownloader() {
        super();
      public static void main(String[] args) throws SQLException,
                                                    DataFormatException,
                                                    UnsupportedEncodingException {
        Connection conn =
          DriverManager.getConnection("jdbc:oracle:thin:@your.db.server:1521:YOURSID",
                                      "username", "password");
        Statement stmt = conn.createStatement();
        ResultSet rs =
          stmt.executeQuery("SELECT IBTRANSACTIONID, IB_SEGMENTINDEX, SEGMENTNO, SUBSEGMENTNO, UNCOMPMIMEDATALEN, MIMEDATALONG\n" +
            "  FROM PSAPMSGPUBDATA\n" +
            //" WHERE IBTRANSACTIONID = 'GUID-GOES-HERE'\n" +
            " ORDER BY IBTRANSACTIONID, IB_SEGMENTINDEX, SEGMENTNO, SUBSEGMENTNO, DATASEQNO\n");
        String id = "";
        while (rs.next()) {
          if(!id.equals(rs.getString("IBTRANSACTIONID"))) {
            id = rs.getString("IBTRANSACTIONID");
            System.out.println("----------------------------------------------------");
            System.out.println("******  " + id + "  ******");
          String segment = rs.getInt("IB_SEGMENTINDEX") + "-" +
                         rs.getInt("SEGMENTNO") + "-" +
                         rs.getInt("SUBSEGMENTNO");
          Inflater inflater = new Inflater();
          byte[] result = new byte[rs.getInt("UNCOMPMIMEDATALEN")];
          inflater.setInput(rs.getBytes("MIMEDATALONG"));
          int length = inflater.inflate(result);
          System.out.println("Segment: " + segment);
          System.out.println(new String(result, 0, length, "UTF-8"));
          System.out.println();
          System.out.println("--");
          System.out.println();
          inflater.end();
    }

  • Osb: Proxy Messaging Service retrieve only xml message that have the proper

    Hi All.
    I have a Proxy Service with Messaging Service type which read xml messages from a queue.
    The Request Message Type in the proxy is xml and I have provided the type information by declaring (in the element and type field) the XML schema type of the XML document exchanged.
    I need the proxy service to retrieve from the queue only the xml messages that have the proper schema.
    But when the proxy retrieves any xml msg in the queue regardless of their schema definition .
    Appreciate your input.
    Thx,
    Ross
    Edited by: user6677631 on Feb 25, 2013 9:52 AM
    Edited by: user6677631 on Feb 25, 2013 10:02 AM

    Selecting the XML schema for request type in a messaging proxy does not ensure the validation of incoming XML message against schema. Similarly if you create a WSDL based proxy the validation against WSDL definition will not happen automatically. Choosing XML as the type of message will only ensure that any malformed XMLs will be rejected before entering the message flow. For validating against schema you will need to explicitly add a validate action within the proxy message flow, if validation fails raise an error and roll back the message to the Queue or log the errored message and commit the message/publish to an error queue.

  • Multiple lines in a Output XML message

    Hi all,
         I am currently implimenting a simple scenario of creating a file in a particular format using XI.The working scenario is that we get an XML message from BO which will be mapped to the required format of the file.But for testing we are using an hardcoded XML file as the incoming message to XI.
         But there is a problem I am facing. The incoming XML message will contain multiple information and this has to be mapped to a header information followed by items.Like for example I have a payment document which has paid some 5 invoices.The incoming XML message will have this information and what I need in the output is to have the invoice information in 5 different lines.
    For eg - Assume I have the following structure for incoming message
    REGUH
    REGUP
    ....and so on
    Here for every REGUH entry we can have mulitple REGUP and also we can have multiple REGUH.
    Say my target structure is -
    Header Info
    Record Info
    so for every REGUH and corresponding REGUP combination I will have a Header Info and Record Info.For the next REGUH and corresponding REGUP I will have another Header and Record Info.
         I tried testing this in message mapping by duplicating the node REGUH and REGUP but it does not work.I also tried by having the occurances as 1 to n on both sides.It did not seem to work.
    Can you guys give some feedback on this.
    Thanks..
    Sandeep

    Manish,
        Thanks for the information.But this was a simple case which works.But in my case I have something like -
    one field in REGUH will appear once in the file while some other fields will appear multiple times.Also I have a lot other structures which are something like this.
    I assume that occurence for both sides should be 1 to n.
    But it does not seem to work for me.Its a bit complicated target structure.

  • How to ignore .dtd

    please help me for this problem
    I have a xml file: datasources.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE data-sources PUBLIC "Orion data-sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    </data-sources>
    and I have this code to parse file xml
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse (new File("datasources.xml"));
    it works ok if I internet connecting is ok. but if i can't connect to internet, i doesn't work, but throws an Exception:
    java.net.UnknownHostException: xmlns.oracle.com
    anybody know how to ignore dtd when parse file xml???
    please help me, thanks in advance,
    TuanTA

    Refer
    http://www.oracle.com/technology/sample_code/tutorials/parser/domdtd/setup.htm#IgnoreDtd

  • XML Declaration missing in  SOAP message

    Hi,
    We have an interface that calls a webservice to create a Product in a 3rd Party System.
    Inbound Message : Material IDOC
    Outbound Message: Product XML for a Create method of a WebService.
    Outbound Adapter: SOAP Adapter
    Issue:
    Product XML is received by the 3rd Party system via the SOAP adapter but the XML declaration tag <? XML Version="1.0" encoding="UTF-8" ?> is missing in the received document.
    Has anyone come across such a situation in the group?
    I would appreciate your valuable inputs and suggestions.
    Thanks Guys,
    Sathia.

    Hi
    Did u solve this problem, I have a similar issue ....

  • Ignore DTD reference in message monitoring (SXMB_MONI)

    Hi All,
    My Inbound Message (to be delivered to the target system) needs to have DTD reference as the target system mandates it.
    In the mapping I have added the DTD Reference (<!DOCTYPE .../>).
    Although the target system is happy ,massage monitoring is complaining that the DTD is missing when I want to display the XML message.This is a support issue as the inbound XML message is not diaplayed  in SXMB_MONI.
    Is there any way to work around it - Configuration or putting the DTDs somewhere in XI server.
    Thanks in Advance,
    Bikram

    Rather than add the DTD reference in a message mapping, you could try add it in a Java module attached to the receiver/outbound module-chain of your target communication channel.  This way the DTD line would not get added until after the message has left the integration server.
    Check out the following guide:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81
    Let me know how you get on.
    (+ please assign me some forum points if you found this useful).
    Thanks,
    Paul Digance.

  • RE: Validating XML message...

    Actually I stand corrected. XML Spy does seem to provide an OLE API to XML
    validation ( the isValid method on the IDocument class ) although I haven't
    tested it yet.
    In my previous post I was thinking of another XML product I tested earlier
    in the week which did not.
    -----Original Message-----
    From: Shaughnessy, Kevin
    Sent: Friday, April 20, 2001 08:59
    To: 'Rumen Georgiev'
    Cc: [email protected]
    Subject: RE: Validating XML message...
    Rumen,
    One idea that is possible is to use an OLE interface to a 3rd party XML
    product. This assumes your logic which needs to validate is running on a
    Windows box. But if so, it may work. Many products have type libraries which
    can be run through OLEGen to create Forte classes. Then you can use TOOL to
    talk OLE to that product.
    For example, XML Spy 3.5 has a type library from which I created a Forte
    project. Unfortunately this product didn't offer any extra features than
    Forte's XMLParser ( i.e. the API didn't allow me to validate the XML ) so I
    am back to using Forte's parser until I can test another product. If you
    find one that does what you want let me know.
    I've used OLE a lot with Forte to get functionality from other products (
    VISIO, MS Office ) that Forte doesn't provide and it works well. Its a
    platform dependent solution but one that may work for you.
    Kevin
    -----Original Message-----
    From: Rumen Georgiev [mailto:[email protected]]
    Sent: Friday, April 20, 2001 07:21
    To: [email protected]
    Cc: [email protected]
    Subject: RE: Validating XML message...
    Hi Kevin,
    From the answers I've got it seems Forte parser is anon-validating one. So we have to look for an external
    tool to validate these messages. What I am concerned
    about is the integration with Forte.
    Thanks for your help!
    Rumen
    Rumen,
    From Tech Note 11811:
    "ParserFactory.makeParser() will return a default,
    non-validating XML parser."
    My experience is that Forte's default XML parser will
    not validate but will throw an exception if the XML
    document is not well formed. I'm using the DOM
    model and this exception happens on the
    Document.importDocument( ) method.
    If you want anything more than that you'll have to do
    it externally.
    Kevin-----Original Message-----
    From: Rumen Georgiev [mailto:[email protected]]
    Sent: Thursday, April 19, 2001 11:49 AM
    To: [email protected]
    Subject: Validating XML message...
    We have to validate inbound XML messages before
    processing them. The guys on the other side are
    following XMLSchema recommendations to create their
    messages using xsd file for validation. We plan to
    use XMLParser Forte library and as far as I know it
    validates against dtd file (haven't tried yet). If
    this is true we have two options:
    1. Find a program to convert xsd into dtd file and
    use Forte XMLParser for validation.
    2. Validate the message beforehand with an external
    tool. That means integration between Forte and this
    tool.
    I would appreciate any help with either approach. Do
    you know of a program doing xsd into dtd? Have you
    used any existing tool on the market to validate
    using XMLSchema? Or may be there is another solution
    to
    this?
    Thank you in advance,
    Rumen
    =====
    Rumen Georgiev
    Forte Developer
    EXE Technologies
    (610) 872-4400 Ext.222
    Do You Yahoo!?
    Yahoo! Auctions - buy the things you want at great prices
    http://auctions.yahoo.com/

    Hi,
    there is some change in the XMLSPy4.3/XMLType Library 1.2 :
    Validation
    One common task on documents is to validate them against an assigned schema or DTD. If the XML file has no schema or DTD already assigned, use "Document.AssignSchema" or "Document.AssignDTD" to add the necessary references to the document.
    Examples:
    objSpy.ActiveDocument.AssignSchema "C:\mySchema.xsd", False
    or
    objSpy.ActiveDocument.AssignDTD "C:\myDTD.dtd", False
    If you want the user to select a schema or DTD, pass True as the second parameter to these functions to display a file-dialog. These methods only put the reference into the document and do not check the existence of the specified file. If the file path is not valid, the validation will fail.
    After you have assigned a valid schema or DTD reference to your file, you are able to validate it with "Document.IsValid". IsValid needs some out-parameters that must be declared as VARIANTs to be accessible from script languages like VBScript and JavaScript.

  • Namespace Element within Outbound XML Message

    Hi there,
    I am using XI 2.0 and trying to map an IDoc to an XML message to be passed onwards via JMS to a 3rd Party MQ System.
    I've created the mapping without too many issues but the 3rd Party says that I need to remove the namespace element tag from my final message as they don't want to see this (It's not in their DTD). Is there any way in XI 2.0 to suppress this part of the XML output so that you only get the main XML definition tag...
    i.e. rather than the final message being...
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MessageType xmlns:ns0="namespace">
    <first_tag>Data<first_tag/>...
    Instead produce...
    <?xml version="1.0" encoding="UTF-8"?>
    <first_tag>Data<first_tag/>...
    Any help would be much appreciated.
    Regards,
    Gordon

    Gordon--
    I think I have some good news, and some bad news.
    The good news is that you should be able to remove the namespace alias declaration attribute ('xmlns:ns0=...')  and namespace qualifiers ('ns0:[tagname]').  You can do this by writing a dispatcher function and adding it to the JMS adapter.
    The bad news is that this means you'll have to code the transformation that removes the tags.  Dispatchers are essentially the 'user exits' of XI.  This transformation can be either Java or XSLT -- XSLT is probably easier for a case like this.
    There is a touch of documentation about how to do this in the adapter engine online help (or the 'Adapter Engine' guide for XI 2.0 SR1).  See the sections for the JMS adapter for help on installing your dispatcher transformation.  See the section "Using the Dispatcher: Example" for a bit of help on using dispatchers.
    If you do it in Java, your dispatcher class will have to be accessible in the adapter engine classpath.  If you do it in XSLT, I'm not sure where the .xsl file goes -- perhaps in the Adapter Engine working directory?
    --Dan King
    Capgemini

  • Unable to Execute a Report to send PAN XML messages out of SNC

    Hi All,
    We are unable to Execute a Report /SCA/DM_TIMESERIES_OUT to send Product Activity Notifications in the form of XML messages out of SNC. We have manitained some Planned Reciepts data in SNC and would like to transfer it out to ECC.
    Could anyone help in understanding if we have to maintain mandatory settings before executing this report.
    Thanks & Regards,
    Sadiq

    Hi Pravin,
    As per the documentation(http://help.sap.com/saphelp_snc70/helpdata/EN/48/6bdb4767a431cbe10000000a42189d/frameset.htm), we have tried both the manual and automatic features to configure the output from SNC in the form of XML messages.
    The manual method gave a message "Time series data for selection is empty" and the Automated method could trigger the XML messages on every incoming message from ECC but we are unable to see the Planned Receipts in that XML messages.
    Was just wondering if we can see the Planned Receipt info by changing the settings of this report or by using any other simillar report as the PR info is very important for our development.
    Thanks & Regards,
    Sadiq

  • Read XML message from a CLOB

    We are currently receiving XML messages from a business partner that goes
    through a transformation/parser first to make sure the xml document was
    in MISMO form (Mortgage Industry Standard Message Organization). Then the
    document is stored in a clob in a table. The document is stored Without
    the tags. We are storing these XML messages into a CLOB datatype for
    later processing. I want to read the CLOB and then parse out the
    individual fields to store into a table. What is the best way to
    accomplish this in PL/SQL? Here is one sample record:
    <MORTGAGEDATA>
    <APPLICATION LoanPurposeType="OTHER">
    <LenderCaseIdentifier>3631681</LenderCaseIdentifier>
    <LendersBranchIdentifier>2966448</LendersBranchIdentifier>
    </APPLICATION>
    <PROPERTY PropertyUsageType="Primary">
    <Address1>1335 test</Address1>
    <City>las cruces</City>
    <State>NM</State>
    <PostalCode>88001</PostalCode>
    </PROPERTY>
    <SUBJECTPROPERTY>
    <SubjectPropertyEstimatedValueAmount>69000</SubjectPropertyEstimatedValueAmount>
    </SUBJECTPROPERTY>
    <BORROWERRECONCILEDLIABILITY LiabilityType="HelocSubjectProperty">
    <LiabilityUnpaidBalanceAmount>0</LiabilityUnpaidBalanceAmount>
    <LiabilityMonthlyPaymentAmount>0</LiabilityMonthlyPaymentAmount>
    </BORROWERRECONCILEDLIABILITY>
    <BORROWERRECONCILEDLIABILITY LiabilityType="MortgageLoanSubjectProperty">
    <LiabilityUnpaidBalanceAmount>0</LiabilityUnpaidBalanceAmount>
    </BORROWERRECONCILEDLIABILITY>
    <BORROWER>
    <FirstName>scooby</FirstName>
    <MiddleName/>
    <LastName>doo</LastName>
    <NameSuffix/>
    <MothersMaidenName>velma</MothersMaidenName>
    </BORROWER>
    </MORTGAGEDATA>
    NOTE: I have tried to use DBMS_XMLQUERY and it comes out like this using a
    stored procedure called printclob: When I do this the data is put into
    one field called xml_app_msg. The problem is how do I reference the
    individual fields like FirstName and so on to store in another table? Can
    I apply a stylesheet and if so, how?
    Or do I create an object type called xml_app_msg with the fields lastname
    and so on?
    -- The table is raw_xml_msg_tbl and the field with the stored infomation is
    xml_app_msg.
    set serveroutput on size 50000
    declare
    queryCtx DBMS_XMLquery.ctxType;
    result CLOB;
    begin
    queryCtx := DBMS_XMLQuery.newContext('select xml_app_msg from raw_xml_msg_tbl where app_id = :APP_ID');
    -- DBMS_XMLQuery.clearBindValue(queryCtx);
    DBMS_XMLQuery.setBindValue(queryCtx,'APP_ID','LT1001');
    -- get the result..!
    result := DBMS_XMLQuery.getXML(queryCtx);
    -- Now you can use the result to put it in tables/send as messages..
    printClobOut(result);
    DBMS_XMLQuery.closeContext(queryCtx); -- you must close the query handle..
    end;
    OUTPUT:
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <XML_APP_MSG><MORTGAGEDATA>
    <BORROWER>
    <FirstName>Falls</FirstName>
    <MiddleName/>
    <LastName>Water</LastName>
    <NameSuffix/>
    <SSN>123-45-6789</SSN>
    </BORROWER>
    </MORTGAGEDATA>
    </XML_APP_MSG>
    </ROW>
    </ROWSET>
    null

    I parse the XML doc into a domdocument and then loop through using xpath.valueof to pull the individual values from the nodes and then build a generic insert. It works quite well with a small number of columns. I'm not sure how it would work with a lot of columns. You can get code examples from Steve Muench's book "Developing Oracle XML Applications".

  • DTD + Schema reference in xml file to be inserted

    Hi,
    I am pasting sample code where I want to have schema + DTD reference. Schema file is used for validating the file and DTD is needed for entity resolution.
    <?xml version="1.0" ?>
    <!DOCTYPE html [
    <!ENTITY reg    "®">
    ]>
    <html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    </head>
    <!-- class="header" -->
    <body>
    Hi all. Register symbol should be displayed now &reg;
    </body>
    </html>I have already registered http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd schema with the DB. But, when I try to insert this xml data in the DB, I'm getting the following error.
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00104: Warning: element "html" is not declared in the DTD
    Error at line 5
    ORA-06512: at "SYS.XMLTYPE", line 296
    ORA-06512: at line 1
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.Anyone please help me in resolving this issue..
    Thanks in advance,
    Divya.
    Edited by: user11853430 on Nov 28, 2010 8:45 PM

    Thanks for the information. I assume you are intending using Schema Based Binary XML storage. Attempting to use Object Realtional storage for XHTML is not something we would recommend. I am checking with development to see if we have a way of using the DTD just for entity resolution. In the mean time the only other solution I can think of it to include the full or partial DTD for XHTML in addition to the entity defintion..
    I tried this, but it doesn't seem to work
    SQL> select XMLTYPE(
      2  '<?xml version="1.0" ?>
      3  <!DOCTYPE html [
      4  <!ENTITY reg    "r">
      5  <!ELEMENT html ANY>
      6  ]>
      7  <html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd">
      8    <head>
      9      <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
    10      <meta http-equiv="Content-Style-Type" content="text/css" />
    11      <meta http-equiv="Content-Script-Type" content="text/javascript" />
    12    </head>
    13
    14  <!-- class="header" -->
    15    <body>
    16      Hi all. Register symbol should be displayed now &reg;
    17     </body>
    18  </html>') from dual
    19  /
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00106: Warning: attribute "xmlns:xsi" of element "html" is undefined
    Error at line 6
    ORA-06512: at "SYS.XMLTYPE", line 310
    ORA-06512: at line 1
    no rows selectedWhat you want is the DTD equivilant of
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="html" type="xs:anyType">
              <xs:annotation>
                   <xs:documentation>Comment describing your root element</xs:documentation>
              </xs:annotation>
         </xs:element>
    </xs:schema>I also tried making the xhtml-strict DTD available... but that did not appear to work
    First load the DTD and ENT files into the repository.
    C:\xdb\examples\DTD>sqlplus /nolog @loadDTD %CD%
    SQL*Plus: Release 11.2.0.2.0 Production on Sat Nov 27 10:55:32 2010
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    SQL> spool loadDTD.log
    SQL> --
    SQL> connect system/oracle
    Connected.
    SQL> --
    SQL> create or replace directory XMLDIR as '&1'
      2  /
    old   1: create or replace directory XMLDIR as '&1'
    new   1: create or replace directory XMLDIR as 'C:\xdb\examples\DTD'
    Directory created.
    SQL> --
    SQL> declare
      2    V_RESULT             BOOLEAN;
      3    V_DTD_FOLDER         VARCHAR2(700) := '/sys/DTD';
      4    V_DTD_TRANSITIONAL   VARCHAR2(700) := '/sys/DTD/xhtml1-transitional.dtd';
      5    V_DTD_STRICT         VARCHAR2(700) := '/sys/DTD/xhtml1-strict.dtd';
      6    V_DTD_STRICT_REG     VARCHAR2(700) := '/sys/DTD/xhtml1-strict+reg.dtd';
      7    V_ENT_LAT1           VARCHAR2(700) := '/sys/DTD/xhtml-lat1.ent';
      8    V_ENT_SYMBOL         VARCHAR2(700) := '/sys/DTD/xhtml-symbol.ent';
      9    V_ENT_SPECIAL        VARCHAR2(700) := '/sys/DTD/xhtml-special.ent';
    10  begin
    11    if (not DBMS_XDB.existsResource(V_DTD_FOLDER)) then
    12      V_RESULT := DBMS_XDB.createFolder(V_DTD_FOLDER);
    13    end if;
    14    if (not DBMS_XDB.existsResource(V_DTD_TRANSITIONAL)) then
    15      V_RESULT := DBMS_XDB.createResource(V_DTD_TRANSITIONAL,bfilename('XMLDI
    R','xhtml1-transitional.dtd'));
    16    end if;
    17    if (not DBMS_XDB.existsResource(V_DTD_STRICT)) then
    18      V_RESULT := DBMS_XDB.createResource(V_DTD_STRICT,bfilename('XMLDIR','xh
    tml1-strict.dtd'));
    19    end if;
    20    if (not DBMS_XDB.existsResource(V_DTD_STRICT_REG)) then
    21      V_RESULT := DBMS_XDB.createResource(V_DTD_STRICT_REG,bfilename('XMLDIR'
    ,'xhtml1-strict+reg.dtd'));
    22    end if;
    23    if (not DBMS_XDB.existsResource(V_ENT_LAT1)) then
    24      V_RESULT := DBMS_XDB.createResource(V_ENT_LAT1,bfilename('XMLDIR','xhtm
    l-lat1.ent'));
    25    end if;
    26    if (not DBMS_XDB.existsResource(V_ENT_SYMBOL)) then
    27      V_RESULT := DBMS_XDB.createResource(V_ENT_SYMBOL,bfilename('XMLDIR','xh
    tml-symbol.ent'));
    28    end if;
    29    if (not DBMS_XDB.existsResource(V_ENT_SPECIAL)) then
    30      V_RESULT := DBMS_XDB.createResource(V_ENT_SPECIAL,bfilename('XMLDIR','x
    html-special.ent'));
    31    end if;
    32    commit;
    33  end;
    34  /
    PL/SQL procedure successfully completed.
    SQL> select ANY_PATH
      2    from RESOURCE_VIEW
      3   where under_path(RES,'/sys/DTD') = 1
      4  /
    ANY_PATH
    /sys/DTD/xhtml-lat1.ent
    /sys/DTD/xhtml-special.ent
    /sys/DTD/xhtml-symbol.ent
    /sys/DTD/xhtml1-special.ent
    /sys/DTD/xhtml1-strict+reg.dtd
    /sys/DTD/xhtml1-strict.dtd
    /sys/DTD/xhtml1-symbol.ent
    /sys/DTD/xhtml1-transitional.dtd
    8 rows selected.
    SQL> quit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64
    bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    C:\xdb\examples\DTD>However even after adding the references to the XML document
    SQL> select XMLTYPE(
      2  '<?xml version="1.0" ?>
      3  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      4          "/sys/DTD/xhtml1-strict+reg.dtd">
      5  <html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.xsd">
      6    <head>
      7      <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
      8      <meta http-equiv="Content-Style-Type" content="text/css" />
      9      <meta http-equiv="Content-Script-Type" content="text/javascript" />
    10    </head>
    11
    12  <!-- class="header" -->
    13    <body>
    14      Hi all. Register symbol should be displayed now &reg;
    15     </body>
    16  </html>') from dual
    17  /
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00217: invalid character 402 (U+0192)
    Error at line 3
    Error at line 34
    Error at line 25
    ORA-06512: at "SYS.XMLTYPE", line 310
    ORA-06512: at line 1
    no rows selected
    SQL>

  • Converting Delimited string to XML message

    Hi,
    We are trying to convert pipe delimited string into a xml schema using a XSD and BPEL funtion. Consider a scenario in which message has 5 fields with last as 2 optional fields. So the incoming string message can be like "1|2|3" or "1|2|3|4|5". In this case how the XSD should look like, since for each field we have to give "terminatedby" option in the XSD. So the issue is coming for element 3 where the delimiter can be "|" or "eol" (end of line). How to specify that ? Is there any option to use like "optionally terminated by?"
    Any help will be appreciated.
    Thanks,
    Ramesh
    Edited by: rameshchandra85 on 2 Aug, 2010 10:00 AM

    Hi Ramesh,
    You can use below XSD for input file of kind
    1|2|3
    1|2|3|4|5
    1|2|3|4
    1|2|3|4|5|6
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
                targetNamespace="http://TargetNamespace.com/InboundService"
                xmlns:tns="http://TargetNamespace.com/InboundService"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified" nxsd:encoding="ASCII" nxsd:stream="chars" nxsd:version="NXSD">
      <xsd:element name="Root-Element">
        <xsd:complexType>
          <xsd:choice minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="terminated" nxsd:terminatedBy="|">
            <xsd:element name="RECORD1" nxsd:conditionValue="1">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD2" nxsd:conditionValue="2">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C5" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD3" nxsd:conditionValue="3">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="RECORD4" nxsd:conditionValue="4">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="C2" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C3" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C4" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C5" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="|" nxsd:quotedBy="&quot;">
                  </xsd:element>
                  <xsd:element name="C6" type="xsd:int" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
                  </xsd:element>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:choice>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
    <!--NXSDWIZ:D:\DBIN\ReadFile.txt:-->
    <!--USE-HEADER:false:-->But in your case if you are getting 5 elements instead of 3 elements in some other file....Use the same and maipulate the last element afterwards.
    I think we can not have an element definition for two scenarios.
    Update you if i get any..
    Regards
    PavanKumar.M

  • Xml message validation or CSV validaion in PI 7.0

    Hi Gurus,
    I need to validate the incoming XML file (source format) in PI 7.0 and if the message is not valid I need to send an email to the sender that the message is invalid.
    I know there is a feature in PI 7.1 XML schema validation done by IE or AAE but is there is any validation feature or do we need write any logic in the mapping editor to validate the incoming XML file.
    Any help appreciated.
    Thanks,
    Jay

    You have to wite JAVA Mapping for the same to validate XML message in PI7.0.
    Refer below link
    http://wiki.sdn.sap.com/wiki/display/XI/XIschemavalidationusingDOMparserviaJavacode
    Regards,
    Raj

Maybe you are looking for