Reg XML to Plain Conversion using B2B add on

Hi All,
This is an outbound scenario where the  message is sent to AS2 receiver channel and the output is Plain file. I have added all the module parameters
and the content type as application/plain. While testing I am facing the error,
Exception caught by adapter framework: XML-Parser error occured while parsing: Cannot initialize XML to plain handlerCan not find a matching configuration for sender party "", service , receiver party ,service , namespace , action  in table B2B_PLA_CTRL_IF.
Can anyone help me on this issue.
Cheers,
Neethu

Hi Neethu,
Did you import the content? See How to install the new B2B add-on , see step 5.1
You need to do this for the message type you want to exchange ((EDI, ansi X.12, ...).
Also, please do step 5.2. I guess this is not the case.
Kind regards,
Dimitri

Similar Messages

  • Need to send XML msg to TP using B2B, but format should be Orcl XML Gateway

    Current Interface:
    ==================
    We have an EBS 11.5.10 with XML Gateway.
    Actively we were exchanging XML data with 5 trading partners (different application maintained by 3rd party) using EBS XML Gateway.
    XML Gateway uses OAG Format (attached the format bellow)
    Future Interface:
    =================
    Our company is in process of moving our EBS 11.5.10 app to Oracle Fusion Apps.
    Oracle Fusion app interfaces will be using Fusion Middleware and B2B.
    For that we doing a POC interface between a Fusion MDM and 1 Trading Partner.
    Problem:
    ========
    But, when sending XML message to other TP using B2B, the format is different. i.e. Message in the XML Format.
    Eg.
    <?xml version="1.0" ?><OUTB_FUS_IND_DATA> <OUTB_FUS_IND TRANSACTION_TYPE="TP_INDIVIDUAL_OB" TRANSACTION_SUBTYPE="INDIVIDUAL.UPDATE"> <OUTB_FUS_IND KEYVALUE="100010058799220" PERSON_FIRST_NAME="Xyz" PERSON_LAST_NAME="Abc"/> </OUTB_FUS_IND></OUTB_FUS_IND_DATA>
    Oracle XML Gateway send message with message envelop, which have attributes as text field and payload in the XML message format (XML Gateway envelope details is below).
    (Sample XML messages goes out: HTTP Body
    TRANSPORT_PROTOCOL=OXTA
    TRANSPORT_PROTOCOL_VERSION=1.0
    REQUEST_TYPE=SEND
    MESSAGE_ID=A1234567890ZZ0987654321
    MESSAGE_TYPE=XML
    MESSAGE_STANDARD=OAG
    TRANSACTION_TYPE=TP_INDIVIDUAL_IB
    TRANSACTION_SUBTYPE=INDIVIDUAL.UPDATE
    DOCUMENT_NUMBER=12345
    PARTYID=9999
    PARTY_SITE_ID=8888
    PROTOCOL_TYPE=HTTPSu2013OXTA
    PROTOCOL_ADDRESS=HTTPS://www.me.com/servlets/oracle.ecx.oxta.
    Therefore, when I receive the document in PI the mapping fails due to an incorrectly formed message payload. For example:
    TRANSPORT_PROTOCOL=OXTA&TRANSPORT_PROTOCOL_VERSION=1.0&REQUEST_TYPE=SEND&MESSAGE_ID=9EA3BD2......
    We want B2B send messages to other TP as same way XML gateway use to send.
    How we solve this issue?
    XML Gateway Envelope (Manual)
    =====================
    In addition to the business document such as a purchase order or invoice in the XML Payload, a set of message attributes are transmitted. Collectively, these attributes are called the XML Gateway envelope.
    This section discusses the XML Gateway envelope and its data in the validation process for inbound messages, or its source of data for its creation for outbound messages. Data entered into the Trading Partner Setup form is referred to as data in the trading partner table. Data entered into the Define Transactions form is referred to as data in the transaction table.
    Most of the data elements are copied from the Trading Partner tables or the Transaction tables to the XML Gateway envelope.
    Attribute
    =========
    MESSAGE_TYPE
    MESSAGE_STANDARD
    TRANSACTION_TYPE
    TRANSACTION_SUBTYPE
    DOCUMENT_NUMBER
    PARTYID
    SOURCE_TP_LOCATION_CODE
    PARTY_TYPE
    PROTOCOL_TYPE
    PROTOCOL_ADDRESS
    USERNAME
    PASSWORD
    ATTRIBUTE1
    ATTRIBUTE2
    ATTRIBUTE3
    ATTRIBUTE4
    ATTRIBUTE5
    PAYLOAD

    First of all EBiz and B2B/BPEL are two different products meant for different purpose and hence you cannot expect that EBiz and B2B/BPEL should have same functionality.
    Whatever headers you have mentioned, those are added by OXTA (Oracle Transport Agent) which is part of EBiz. You can add almost all these headers in Oracle B2B in "Additional transport headers" section of Transport Protocol Parameter.
    Search for "Additional transport headers" at below link -
    http://docs.oracle.com/cd/E23943_01/user.1111/e10229/b2b_tps.htm#BABBCDHI
    Regards,
    Anuj

  • Need information on how to integrate bank interfaces for 820,824 transaction using B2B add on

    HI All,
    Can anyone share some knowledge on how to integrate 820,824 transactions using PI B2B add on .
    I have downloaded B2B mapping kit and B2B toolkit into IR and uploaded SCA files into PI server.
    But I can not see any mappings provided for 820/824 by SAP in B2B mapping kit.
    Please share your comments.
    Regards,
    Dinesh

    Hi Dimitri,
    I am looking for 820,824 for ANSIX12 format.
    And i guess SAP has provided example mappings only for 810,830 and 850.
    I am unable to see the example mappings provided by sap for 820/824 in B2B mapping toolkit.
    Is there any way or place to find the example mappings for these formats?
    Regards,
    DInesh Male

  • Xml to html conversion using xslt

    xml contains exponential no i.e. number in scientific notation. When it is converd to HTML, we get NaN for that number. It happens in JDK 1.4 i.e. WLS8.1 with jdk 1.4 bea jrockit jvm.
    It worked fine with wls7 using xalan-j_2_1_0/bin/xalan.jar
    ANy solution?

    Do you know of a method in the xdk that takes a well formed HTML doc and using xsd / xslt convert back to original xml spec?
    Because you created (and as long as you create) the HTML from XML it will be well formed (every tag will be ended with an end-tag) and you can therefore transform it back into XML.
    Most times it will not be possible to convert HTML found on the 'internet' into XML because this HTML is not well formed. For example, many people forget to end a paragraph of text within HTML with the </p> tag.
    We are evaluating using xslt to convert the XML to a form based medium for content maintenance. Wondering if once a XML document is parsed to HTML (DOM) can it be parsed back to XML for subsequent update to stored value in blob column. Specifically interested in conversion (parser) from HTML to XML
    Simply can HTML (in DOM format validated against a xsd) be transformed back to XML ?

  • XML to SQL conversion using OracleXML putXML

    Hi,
    How many rowTag values can I use when I use OracleXML putXML ? I have an XML file in the following format.
    I have to use "ABC" as rowTag. What Can I do with "GRANT_ROW" ? I have a table with
    R_DATE and
    GRANT columns
    where GRANT is an object type with elements
    NAME and ATYPE.
    Thanks.
    <?xml version = '1.0'?>
    <EXCH>
    <ABC num="1">
    <R_DATE>5/21/2003 0:0:0</R_DATE>
    <GRANT>
    <GRANT_ROW num="1">
    <NAME>GUNACAR</NAME>
    <ATYPE>TE</ATYPE>
    </GRANT_ROW>
    <GRANT_ROW num="2">
    <NAME>GUNACAR</NAME>
    <TYPE>TE</TYPE>
    </GRANT_ROW>
    </GRANT>
    </ABC>
    </EXCH>
    I get the following error when I run
    java OracleXML putXML ....
    oracle.xml.sql.OracleXMLSQLException: 'The XML element tag 'GRANT_ROW'
    does not match the name of any of the columns/attributes of the
    target database object.' encountered during processing ROW element 0.
    Thanks....

    RTF FormattingKit
    http://www.schema.de/sitehtml/site-e/xmlnach0.htm

  • Classifier mapping to read Sender & Receiver  Identification Number from XML. How to handle in B2B Add on

    In current See burger tool, We have this functionality to read Sender and Receiver Identification number from the XML. Is there any way in b2b add on to do this.

    Hi,
    The classifier within the Seeburger context is being used to call your parent mapping, in case you want to dynamically determine your mapping, based on data in the UNB/UNH segment.
    Within the B2B add-on, there is no need to.
    Only use module localejbs/EdifactConverterModule in case you want to convert to or from EDI.
    You have a specific requirement or do you want to test something out?
    Kind regards,
    Dimitri

  • Complex XML to Plain in JMS adapter "Content conversion module"

    Hi!
    I have read the document on "How To… use the content conversion module with XI3.0 J2EE JMS Adapter", and it says only SimpleXML can be converted in the receiver channel.
    I had hoped for a solution at least as good as in the File/ftp adapter, where complex XML can be transformed to files.
    Are there plans to include complex XML conversion in the JMS adapter?
    I can not use the file adapter as I need to change the file name and destination, and that can not be done by adding own module to its single module.
    Any idea how I can achieve what I want?
    To only way I can find, is to create a file using the file/ftp adapter, and then pick it up again and treat all the lines as the same structure (one row = one xml field). Then output this new xml message to file, using the JMS adapter and add any modules with name and destination determination.
    Appreciate any help!
    Regards,
    Oeystein Emhjellen

    Hello,
    Have you tried to use an XSLT mapping within the IE?
    I have, at one customer site, created a XSLT message mapping which converts the  XML to a fixed length ASCII file format. I than added the XSLT message mapping as a second mapping step on the interface mapping.
    In this case I was able to publish a fairly complex fixed length file format to MQ Series via the JMS adapter.
    /Johan

  • B2B Add on -  Party configuration using B2B - AS2 Aadapter

    Can anyone help me  to configure Party using B2B AS2 Adapter .
    I tried configuring the channel using Party passing the Sender ID . Getting this error.
    Cannot get channel binding: com.sap.aii.af.service.cpa.CPAObjectNotFoundException: Couldn't retrieve binding for the given channelId: Binding:CID=67140c68525433f4a8468af588477d5e;

    Hi Mithali,
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cdded790-0201-0010-6db8-beb9bb2b2660?QuickLink=index&…
    Under Sender Agency; put <your Business Service / System / Comm. Comp name>; example XID_112 or whatever
    Under Sender Schema; put ALE#KU; if your Partner type of Sender is KU in WE20
    This combination will derive the sender Party.
    Similarly you can put the receiver boxes if you want to de-normalise and derive the receive party name.
    Let me know if it helps; else can help you more!!
    Thanks
    Saurabh

  • Sap pi b2b add-on

    Hello
    We are currently planning on getting on SAP PI B2B ADD-ON. Currently we generate the EDI formatted file using file content conversion in the receiver file adapter. It is a very laborious task.
    Does getting the B2B ADD-ON eliminate the file content conversion to produce the EDI file format ? Also how much time would cost would be saved if we got the b2b ADD-ON? Is there anyone who is doing file content conversion to generate the edi file format ? What are your thoughts?
    Thanks!

    Hi ,
    Go through below link.
    The SAP PI B2B add-on EDI capabilities unveiled
    Regards
    Venkat

  • B2B add-on

    Hi,
    We all know that B2B scenario involves Party to Party  communication as the systems involved
    in message exchange are in different landscapes.We also checkbox for sender uses virtual receiver
    while creating receiver determination.
    We have one B2B scenario where (EDI to IDoc-XML)  parties are not  used.
    Does B2B add on eliminates the need for party to party comunication?
    Regards,
    Mayank Yadav

    Thanks All for Help,
    Actually in my scenario B2B add on was installed and Parties were not used.
    So I got confused why Party is nt used here since its a B2B.
    Now I got a clear idea about B2B addon- it converts EDI to  EDI-XML
    just like Seeburger BIC mapping Designer does for Seeburger AS2 adapter.
    Morever Party was not used here(in my B2B scenario where B2B add on was installed;business component is used instead of Business system) because 1 sender and 1 receiver system is there. 
    Party will be used only when we have multiple external sender/receiver systems across the landscape so that they can be identified with globally valid IDs.

  • Error in StrictXml2PlainBean (XML to Text Conversion)

    Hi All,
    I am trying to convert the XML to Plain file in receiver file adapter. I am using module - StrictXml2PlainBean.
    Below is my target structure
    B2B_HEADER (1..1)                    Level1
    SHIPMENT_HEADER(1...1)          Level1
    SHIPMENT_CUSTOMER  (1..Unbounded)     Level1
       CARTON_HEADER     (1..Unbounded)         Level2 Child node of Shipment_customer
         CARTON_DETAIL  (1..Unbounded)         Level3 Child node of Carton_header
    I have mention below parameters in module tab,
                          B2B_Header.endSeparator             \n
         B2B_Header.fieldLengthExceeded     cut
         B2B_Header.fieldLengths     8,8,8,16,15,14,5,38,14,66,8
         Carton_Detail.endSeparator     \n
         Carton_Detail.fieldLengthExceeded     cut
         Carton_Detail.fieldLengths     6,14,4,10,14,10,35,10,6
         Carton_Header.endSeparator     \n
         Carton_Header.fieldLengthExceeded     cut
         Carton_Header.fieldLengths     6,20,20,12,2,7,2
         Shipment_Customer.endSeparator     \n
         Shipment_Customer.fieldLengthExceeded     cut
         Shipment_Customer.fieldLengths     6,8,10,40,40,40,40,40,10,2,15,40,1
         Shipment_Header.endSeparator     \n
         Shipment_Header.fieldLengthExceeded     cut
         Shipment_Header.fieldLengths     6,20,4,20,35,30,10,30,3,3,35,35,30,10,30,3,30,10,30,30,9,10,3,30,6,12,14,3
         recordTypes     B2B_Header,Shipment_Header,Shipment_Customer,Carton_Header,Carton_Detail
    I have getting below error in communicatipon channel monitoring...
    *Message processing failed. Cause: com.sap.aii.af.app.modules.conversion.xml2plain.ConversionException: The element nesting level for the structure Shipment_Customer is too deep (reference: 3 levels, found: 4 levels) at XML element CreateAndAcknowledgePickPackShipmentGIS_Async_V01,Shipment_Customer,Carton_Header,RecordIndicator
    RecordIndicator is a field in Carton_Header. Am i missing something in the configuration?
    Regards
    Amol
    Edited by: AMOL BHARTI on Dec 24, 2010 8:59 AM

    Hi Amol,
    You XML structure contains deep levels. As far as i understand about the StrictXML2PlainBean module, this is not capable of handling deep structures.
    This module is just an alternative to use FCC type functionality for other receiver adapters.
    Please take a look at these links:
    https://help.sap.com/saphelp_nwpi711/helpdata/EN/44/748d595dab6fb5e10000000a155369/content.htm
    StrictXml2PlainBean - to have an XML - EDI conversion?
    In case you want to achieve nested level content conversion, you may try this:
    /people/karthiknarayan.kesavan2/blog/2007/08/22/file-content-conversion-for-multi-hierarchical-structure
    I hope this helps.
    Regards, Gaurav.

  • XSU error oracle.xml.sql.OracleXMLSQLException: Conversion to String failed

    Appication Server: 10g, Database: Oracle 9i and Oracle 10g
    I have a table 'sw_icd2' in the database that has one column of XMLType.
    The code below, attempts to query this table as 'select * from sw_icd2' and display the result. I was able to execute this query in sqlplus.
    But when I run a program using XSU in JDeveloper:
    OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from sw_icd2");
    XMLDocument domDoc = (XMLDocument)qry.getXMLDOM();
    domDoc.print(System.out);
    StringWriter s = new StringWriter(10000);
    domDoc.print(new PrintWriter(s));
    System.out.println(s.toString());
    qry.close();
    I get the following Error:
    "oracle.xml.sql.OracleXMLSQLException: Conversion to String failed"
    Any ideas on how I can resolve this issue? Your help would be appreciated.
    Thanks!

    Okay, it looks like the problem has something to do with the TIMESTAMP data type in tables.
    oracle.xml.sql.query.OracleXMLQuery can't seem to handle tables with the TIMESTAMP data type.
    this code ran fine on my machine :
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    import java.lang.*;
    import java.sql.*;
    public class testXMLSQL {
         public static void main(String[] args) {
    try {
    // Create the connection
    System.out.println("before getConnection ");
    Connection conn = getConnection("scott","tiger");
    System.out.println("after getConnection ");
    // Create the query class
    OracleXMLQuery qry = new OracleXMLQuery(conn, "SELECT * FROM EMP");
    System.out.println("after OracleXMLQuery object created ");
    // Get the XML string
    String str = qry.getXMLString();
    // Print the XML output
    System.out.println("The XML output is:\n"+str);
    // Always close the query to get rid of any resources..
    qry.close();
    } catch(SQLException e) {
    System.out.println(e.toString());
    // Get the connection given the user name and password.!
    private static Connection getConnection(String username,
    String password)
    throws SQLException
    // register the JDBC driver..
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    // Create the connection using the OCI8 driver
    Connection conn =
    DriverManager.getConnection(
    "jdbc:oracle:thin:@<server_name>:1521:<sid>",
    username,password);
    return conn;
    Then I created another table :
    create table emp_test as select * from emp;
    added a timestamp to it :
    alter table emp_test add (time timestamp(6));
    and filled it with timestamp information :
    update emp_test set time = timestamp'2005-09-22 09:26:50.124';
    ran the same code but changed the SQL to :
    "SELECT * FROM EMP_TEST"
    and got the error message :
    The XML output is:
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Conversion to String failed</ERROR>
    looks like bug in OracleXMLQuery object??

  • Attach an xml to a pdf using ADS

    Hi all,
    I have a scenario where we are sending a Base64 encoded PDF (a bill) and the corresponding xml data from SAP backend on level 4.6C to PI 7.1. In PI we should attach the xml data to the PDF. I have already succeeded to do this using iText but we have a requirement to do this with ADS instead. In Netweaver Developer Studio I created an example project where I am reading a PDF as a byte array, also reading an XML file and try to attach the XML to the PDF using the ADS api. The project successfully built in NWDS but when I am running the project it failes.
    I am using standard code to attach the xml stream to the pdf, the error message is thrown when the following line is executed:
    IWDPDFDocument document = context.execute();
    Exception in thread "main" java.lang.ExceptionInInitializerError
         at com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.impl.PDFDocumentAccessibleContextWDImpl.execute(PDFDocumentAccessibleContextWDImpl.java:99)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.addAttachmentWithSap(PdfWithAttachment.java:129)
         at com.eon.xi.dijnet.base64.PdfWithAttachment.main(PdfWithAttachment.java:218)
    Caused by: java.lang.NullPointerException
         at com.sap.tc.webdynpro.services.sal.deployment.core.DeployableObjectInternal.getSystemDeployableObjectName(DeployableObjectInternal.java:53)
         at com.sap.tc.webdynpro.clientserver.uielib.adobe.impl.AdobeFormHelper.<clinit>(AdobeFormHelper.java:115)
         ... 3 more
    Is it the problem with the PDF that it is not an Interactive Form?
    Or the problem is simply that I am trying to run the project on my local machine where ADS is not available?
    Thanks for your help.
    Pal
    Edited by: Pal Somogyi on Oct 17, 2010 10:30 PM
    Edited by: Pal Somogyi on Oct 18, 2010 11:44 AM

    Hi Pal,
    There is a requirement to generate an Adobe Form using SAP Interactive forms, and then, send this PDF to a non-SAP system using Base-64 encoding. The receiving system will decode this file and re-generate a PDF.
    I have heard that this could be done in the PI layer, using the Conversion Agent.
    Another approach which I can think of is convert PDF to binary and then use the cl_http_utility=>encode_base64 to convert binary to base64.
    You have mentioned that you have had to send a base 64 encoded pdf. Could you pelase guide me through the process?
    Thanks,
    Preethi.

  • XML-2-TXT conversion

    All,
    We have a small, annoying problem with xml-2-text conversion.  During the conversion, the "&amp;: in the XML file is not translated to "&" (ampersand).
    We encounter this issue with the xml-2-txt convertor of the file adapter of the standalone J2SE adapter.
    Anyone having a simple workaround for this small but annoying issue?
    Kind regards, Guy Crets

    I have not used the J2Se adapter, however I wrote a java mapping program that converts XML2TXT, it is highly experimental. You may use it as the last mapping in the mapping program "chain". The XSLT is at the end.
    I have tested this with
    XML -> fileadapter -> SAP XI javamapping -> http adapter -> MS IIS.
    Good luck /Otto
    Created on 2005-dec-05
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    @author 01ottfro Otto Frost Capgemini
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import java.util.HashMap;
    import com.sap.aii.mapping.api. AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    //import java.io.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    //import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    //import java.io.File;
    import java.io.IOException;
    import java.io.ByteArrayInputStream;
    //import java.io.ByteArrayOutputStream;
    import java.io.StringReader;
    //import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.UnsupportedEncodingException;
    import org.w3c.dom.Document;
    //import org.w3c.dom.DOMException;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    //import javax.xml.parsers.*;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.NamedNodeMap;
    public class XML2TEXT implements StreamTransformation {
      private Map           param = null;
      private AbstractTrace  trace = null;
      private StringBuffer sbTrace = new StringBuffer();
      public void setParameter (Map param) {
        this.param = param;
        //if (param == zero) {
        if ((param == null)) {
               this.param = new HashMap();
      public void execute(InputStream in, OutputStream out) {
        try {
          //javax.xml.parsers.DocumentBuilderFactory = "";
           trace = (AbstractTrace)param.get(
             StreamTransformationConstants.MAPPING_TRACE);
           trace.addInfo("Start");
           trace.addInfo(System.getProperty("javax.xml.parsers.DocumentBuilderFactory "));
           InputStreamReader isr = new InputStreamReader(in,"UTF-8");
           in.reset();
           StringBuffer sb2 = new StringBuffer();
           char c;
           int i = isr.read();
           while (i != -1) {
                c = (char) i;
              sb2.append(c);
              i = isr.read();
           String ss = new String(sb2);
           trace.addInfo(ss);
           in.reset();
           String receiverName = (String)param.get(
             StreamTransformationConstants.RECEIVER_NAME);
           //static Document document;
           Document document;
           StringBuffer sb = new StringBuffer();
           StringBuffer sbTrace = new StringBuffer();
           sb.append("");
           sb.append("<?xml version=\"1.0\"?>");
           sb.append("<DOC>");
    //          sb.append("<greeter>An XSLT Programmer</greeter>");
    //          sb.append("<greeting>Hello, World!</greeting>");
           sb.append("<TEXT>x_content_x</TEXT>");
           sb.append("</DOC>");
           //String s = sb.ToString();
           StringReader sr = new StringReader(sb.toString());
           DocumentBuilderFactory dbf = new DocumentBuilderFactory();
           dbf.setCoalescing(true);
           dbf.setExpandEntityReferences(true);
           dbf.setIgnoringComments(true);
           dbf.setIgnoringElementContentWhitespace(false);
           dbf.setNamespaceAware(true);
           dbf.setValidating(true);
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           factory.setCoalescing(true);
           factory.setExpandEntityReferences(true);
           factory.setIgnoringComments(true);
           factory.setIgnoringElementContentWhitespace(false);
           factory.setNamespaceAware(true);
           factory.setValidating(false);
           try {
              DocumentBuilder builder = factory.newDocumentBuilder();
             builder.setErrorHandler(
               new org.xml.sax.ErrorHandler() {  // ignore fatal errors (an  exception is guaranteed)
                 public void fatalError(SAXParseException exception)
                 throws SAXException {
                 // treat validation errors as fatal
                 public void error(SAXParseException e)
                 throws SAXParseException {
                   throw e;
                 // dump warnings too
                 public void warning(SAXParseException err)
                 throws SAXParseException {
                   System.out.println("** Warning"
                      + ", line " + err.getLineNumber()
                      + ", uri " + err.getSystemId());
                        trace.addInfo("** Warning"
                        + ", line " + err.getLineNumber()
                        + ", uri " + err.getSystemId());  
                   System.out.println("   " + err.getMessage());
                     trace.addInfo("   " + err.getMessage());
              //document = builder.parse( new File(args[0]) );
              ByteArrayInputStream bais = new
              ByteArrayInputStream(sb.toString().getBytes("UTF-8"));
                //System.out.println (bais.toString());
              //document = builder.parse(bais);
              document = builder.parse(in);
              Element documentRootElement = document.getDocumentElement();
              trace.addInfo("root" + documentRootElement.getNodeValue());
              trace.addInfo("root" + Short.toString(documentRootElement.getNodeType()));
              trace.addInfo("root" + documentRootElement.getNodeName());
    //          Element textElement = (Element) documentRootElement.getFirstChild();
              NodeList nodeList = documentRootElement.getElementsByTagName("TEXT");
            StringBuffer sbText = new StringBuffer();
              for(i = 0; i<nodeList.getLength() ;i++) {
                   Element textElement = (Element) nodeList.item(i);
                   Node text = textElement.getFirstChild();
                   sbText.append(text.getNodeValue());
              nodeList = documentRootElement.getElementsByTagName("CHARSETNAME");
              StringBuffer sbCharset = new StringBuffer();
              for(i = 0; i<nodeList.getLength() ;i++) {
                   Element textElement = (Element) nodeList.item(i);
                   Node text = textElement.getFirstChild();
                   sbCharset.append(text.getNodeValue());
    //          System.out.println(textElement.getNodeValue());
    //          System.out.println(textElement.getNodeType());
    //          System.out.println(textElement.getNodeName());
              trace.addInfo("te" + textElement.getNodeValue());
              short nodeType = textElement.getNodeType();
              trace.addInfo("te" + Short.toString(nodeType));
              trace.addInfo("te" + textElement.getNodeName());
              Node textNode = textElement.getFirstChild();
              Node mt_textdocument = document.getFirstChild();
              Node text = mt_textdocument.getFirstChild();
              Node hashtext = text.getFirstChild();
              textNode = hashtext;
              String s = new String();
              if (textNode != null) {          
                   trace.addInfo(textNode.getNodeValue());
                   trace.addInfo(Short.toString(textNode.getNodeType()));
                   trace.addInfo(textNode.getNodeName());
                  s = new String(textNode.getNodeValue());
              else {
                   s = "ERROR";
                   trace.addInfo(s);
    //          traverse1(document);
    //          trace.addInfo(sbTrace.toString());
    //          OutputStream baos = new ByteArrayOutputStream();
            String s = sbText.toString();
            String charset = sbCharset.toString();
              byte[] bytes = s.getBytes(charset);
    //          baos.write(bytes,0,bytes.length);
            out.write(bytes,0,bytes.length);
           } catch (SAXException sxe) {
               // Error generated during parsing
               Exception  x = sxe;
               if (sxe.getException() != null)
                    x = sxe.getException();
               x.printStackTrace();
           } catch (ParserConfigurationException pce) {
               // Parser with specified options can't be built
               pce.printStackTrace();
           } catch (IOException ioe) {
               // I/O error
               ioe.printStackTrace();
         catch (UnsupportedEncodingException uee) {
              trace.addInfo("UnsupportedEncodingException");
        catch (IOException ioe) {
          // I/O error
          //  ioe.printStackTrace();
           trace.addInfo("IOException");
        finally {
              trace.addInfo("finally");
      public void traverse1(Node node) {
           do {
               System.out.println("Node: name=" + node.getNodeName() +
               ", value=" + node.getNodeValue() + ", type=" +
               node.getNodeType());
               sbTrace.append("Node: name=" + node.getNodeName() +
              ", value=" + node.getNodeValue() + ", type=" +
              node.getNodeType() + "\n");
              trace.addInfo("Node: name=" + node.getNodeName() +
              ", value=" + node.getNodeValue() + ", type=" +
              node.getNodeType() + "\n");
               if (node.getFirstChild() != null) {
                System.out.println("Processing children:");
                sbTrace.append("Processing children:"+"\n");
                trace.addInfo("Processing children:"+"\n");
                traverse1(node.getFirstChild());
           }  while ((node = node.getNextSibling()) != null);
         public void traverse2(Node node) {
              //Get the children of this Node
                NodeList children = node.getChildNodes();
                //go through all the children of the node
                for (int i=0; i<children.getLength(); i++) {
                    //get the next child
                    Node child = children.item(i);
                    //get the type of the child
                    short childType = child.getNodeType();
                    if (childType == Node.ELEMENT_NODE) {
                   //if the child is an Element then print the start and end
                   //tags and recurse the content       
                   String nodeName = child.getNodeName();
                   System.out.print("<" + nodeName + ">");
                   sbTrace.append("<" + nodeName + ">");
                   trace.addInfo("<" + nodeName + ">");
                   traverse2(child);
                   System.out.print("</" + nodeName + ">");
                   sbTrace.append("</" + nodeName + ">");
                   trace.addInfo("</" + nodeName + ">");
                } else if (childType == Node.TEXT_NODE) {
                   //if the child is a Text node just print the text content
                   String data = child.getNodeValue();
                   System.out.print(data);
                   sbTrace.append(data);
                   trace.addInfo(data);
         public void traverse3(Node node, int indent) {
              for (int i = 0; i < indent; i++) {
                System.out.print("   ");
                sbTrace.append("   ");
                trace.addInfo("   ");
              int type = node.getNodeType();
              switch (type) {
              case Node.ATTRIBUTE_NODE:
                System.out.println("ATTRIBUTE_NODE");
                sbTrace.append("ATTRIBUTE_NODE"+"\n");
                trace.addInfo("ATTRIBUTE_NODE"+"\n");
                break;
              case Node.CDATA_SECTION_NODE:
                System.out.println("CDATA_SECTION_NODE");
                sbTrace.append("CDATA_SECTION_NODE"+"\n");
                trace.addInfo("CDATA_SECTION_NODE"+"\n");
                break;
              case Node.COMMENT_NODE:
                System.out.println("COMMENT_NODE");
                sbTrace.append("COMMENT_NODE"+"\n");
                trace.addInfo("COMMENT_NODE"+"\n");
                break;
              case Node.DOCUMENT_FRAGMENT_NODE:
                System.out.println("DOCUMENT_FRAGMENT_NODE");
                sbTrace.append("DOCUMENT_FRAGMENT_NODE"+"\n");
                trace.addInfo("DOCUMENT_FRAGMENT_NODE"+"\n");
                break;
              case Node.DOCUMENT_NODE:
                System.out.println("DOCUMENT_NODE");
                sbTrace.append("DOCUMENT_NODE"+"\n");
                trace.addInfo("DOCUMENT_NODE"+"\n");
                break;
              case Node.DOCUMENT_TYPE_NODE:
                System.out.println("DOCUMENT_TYPE_NODE");
                sbTrace.append("DOCUMENT_TYPE_NODE"+"\n");
                trace.addInfo("DOCUMENT_TYPE_NODE"+"\n");
                break;
              case Node.ELEMENT_NODE:
                System.out.println("ELEMENT_NODE");
                sbTrace.append("ELEMENT_NODE"+"\n");
                trace.addInfo("ELEMENT_NODE"+"\n");
                NamedNodeMap atts = node.getAttributes();
                for (int i = 0; i < atts.getLength(); i++) {
                   Node att = atts.item(i);
                   traverse3(att, indent + 1);
                break;
              case Node.ENTITY_NODE:
                System.out.println("ENTITY_NODE");
                sbTrace.append("ENTITY_NODE"+"\n");
                trace.addInfo("ENTITY_NODE"+"\n");
                break;
              case Node.ENTITY_REFERENCE_NODE:
                System.out.println("ENTITY_REFERENCE_NODE");
                sbTrace.append("ENTITY_REFERENCE_NODE"+"\n");
                trace.addInfo("ENTITY_REFERENCE_NODE"+"\n");
                break;
              case Node.NOTATION_NODE:
                System.out.println("NOTATION_NODE");
                sbTrace.append("NOTATION_NODE"+"\n");
                trace.addInfo("NOTATION_NODE"+"\n");
                break;
              case Node.PROCESSING_INSTRUCTION_NODE:
                System.out.println("PROCESSING_INSTRUCTION_NODE");
                sbTrace.append("PROCESSING_INSTRUCTION_NODE"+"\n");
                trace.addInfo("PROCESSING_INSTRUCTION_NODE"+"\n");
                break;
              case Node.TEXT_NODE:
                System.out.println("TEXT");
                sbTrace.append("TEXT"+"\n");
                trace.addInfo("TEXT"+"\n");
                break;
              default:
                System.out.println("???");
                sbTrace.append("???"+"\n");
                trace.addInfo("???"+"\n");
                break;
              for (Node c = node.getFirstChild(); c != null; c =
              c.getNextSibling()) {
                traverse3(c, indent + 1);
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:trema-com:trema:trema" targetNamespace="urn:trema-com:trema:trema">
         <xsd:element name="MT_TEXTDOCUMENT" type="DT_TEXTDOCUMENT" />
         <xsd:complexType name="DT_TEXTDOCUMENT">
              <xsd:annotation>
                   <xsd:appinfo source="http://sap.com/xi/TextID">
                   70d8cec1675c11da822400132107c3b7
                   </xsd:appinfo>
              </xsd:annotation>
              <xsd:sequence>
                   <xsd:element name="TEXT" type="xsd:string">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             cc2dc340659311dab38eeb8f0ace6159
                             </xsd:appinfo>
                        </xsd:annotation>
                   </xsd:element>
                   <xsd:element name="CHARSETNAME" type="xsd:string">
                        <xsd:annotation>
                             <xsd:appinfo source="http://sap.com/xi/TextID">
                             bf0f424065c211da893ceb8f0ace6159
                             </xsd:appinfo>
                        </xsd:annotation>
                   </xsd:element>
              </xsd:sequence>
         </xsd:complexType>
    </xsd:schema>
    example xml
    <?xml version="1.0" encoding="utf-8"?>
    <MT_TEXTDOCUMENT><TEXT>your text</TEXT><CHARSETNAME>UTF-8</CHARSETNAME></MT_TEXTDOCUMENT>

  • MDS-01401: Fails in updating configuration using B2B console

    Hello B2B experts,
    I am getting the following error applying any changes to the TP using B2B console. I checked the log and it doesn't give me more information than the following one. I restarted both weblogic and soa severs, and still it is throwing the same error.
    MDS-01401: Updating a node in one document "/soa/b2b/tp_MyCompany.xml" using a node from a different document "/soa/b2b/tp_MyCompany.xml.bak" is not allowed.
    ADF_FACES-60097: For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096: Server Exception during PPR, #39
    Any ideas on this one?
    Thanks in advance!

    Thanks Anuj for quick response.
    There was a problem with one of the file, tp_MyCompany.xml has been backed up by one of our developer as tp_MyCompany.xml.bak and he included that in the exported TP file. When we did an import of that file, the .bak file took precedence over the .xml file. Rather, B2B was trying to update both the files I believe and it was throwing out the expcetion. I deleted the .bak file and reimported it again and everything is now working as expected.
    Regards!
    Edited by: user021211 on Jul 19, 2011 8:23 AM

Maybe you are looking for