XML Payload Validator SAP PI 7.1

Boas
Estou com um problema em um interface, mais propriamente em um campo do mesmo que é um string (50). E este campo esta a ser enviado com 51 caracteres, e mesmo assim o PI aceita sem qualquer tipo de validação anterior, o que vai gerar um dump na maquina destino. Estive a ver e é possível usar um XML Validator, alguém me pode explicar como é que funciona ao certo. Ja estive a ler e sei que e necessário importar o XSD e depois colocar no root do PI, mas mais que isso não sei.
Obrigado
Ruben Catrona

No PI 7.1 existe a funcionalidade sim.
A validacao é baseada na definicao da sua messagem no service interface. No caso, vc tem q definir no Data Type que o tamanho maximo do campo é 50 (ou no XSD a partir do qual a interface foi criada).
Veja o item 3 aqui:
http://help.sap.com/saphelp_nwpi71/helpdata/EN/b1/f29e7a56e18a439984a3c6630951d2/frameset.htm
E esse link:
http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/0bf1b3ec732d2fe10000000a11466f/frameset.htm
Abs,
Henrique.

Similar Messages

  • SSL/TLS security certificate data match with XML Payload in SAP PI

    Hi,
    We are working on a solution where we would want to use SSL/TLS or WS Security with client server mutual authentication using client server certificates.
    But, once the sender is authenticated using the certificates, can the XML payload be matched for the correctness with the certificate information? Is this available to PI integration engine at any time? Like Sender A autheticated as A using certificates, must be stopped if his XML payload is saying that he is sender B (which is most unlikely if we trust the senders but did not want to leave a loophole).
    Any ideas here?
    Thanks and Regards,
    Vijay

    Hi Wolfgang,
    Cross-posting is discouraged and against the forum rules, because it is misused and makes a mess of the search due to distributed discussions and answers.
    I will move it to the PI forum and add a watch on it as it is security forum related.
    Unfortunately, the forum software does not have the option to "mirror" threads.
    Cheers,
    Julius
    Edited by: Julius Bussche on Sep 14, 2009 9:50 PM

  • Doubt in XML payload validation in PI 7.1

    Dear All,
    I understand that the PI message payload can be validated against a XSD/XML structure..
    but i do not understand its advantage as the payload will by default be validated against our source data type..
    then why do we need it to get validated against some other xml at adapter/IE level

    Dear Ravi,
    A very good question asked by you... Actually to tell there is not much of an advantage...
    What it actually does is..
    1)XML Validation allows you to check the structure of a PI message payload. The structure check is
    performed using saved data types.
    2)Syntax validation of the incoming message payload is done at the Advanced Adapter Engine and at
    the Integration Engine against their XML Schema stored in the File System.
    3)Syntax validation of outgoing message payload is done at the Integration Engine against their XML
    Schema stored in the File System.
    And regarding your question why do we need it ..." This feature is demanded by the customers. "
    Source:https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/406a97c4-748c-2a10-f2be-cb63c5b0a11f
    Rgds
    joel

  • Validating XML Payload

    Hi,
    I have written a document/literal style web service that takes DOM Document as input and returns a DOM Document .
    In doc/lit style web services the DOM document will be opened and passed as XML payload in the request message.
    I want to validate this xml payload in the wsdl.
    Any ideas about how i can do this?
    Karan

    either, or, or download some freebee.

  • Adapter Engine XML Schema Validation Error Surpression

    We recently developed a number of web services that are called by 3rd parties outside our network. The web service request once made is picked up by a Web Dispatcher which then forwards the request to the de-central adapter. Both of these components reside within within a DMZ.
    We have, as an additional security measure made use of the new Adapter Engine XML Schema validation available with PI 7.1, to ensure that the payload of incomming messages is checked to ensure that it is a known structure.
    Now here is my problem, we recently had these services penetration tested by a 3rd party to ensure that they were secure and whilst the report was very good showing no major weaknesses they did pickup on a couple of items including that the fact that if the XSD to be used during payload message validation cannot be found an 'ADAPTER.JAVA_EXCEPTION' is returned to the web service consumer that highlights the path details of where the XSD should be (but could not be found).
    This was viewed as useful to an attacker for a number of reasons:
    1. Feedback in SQL injection attempts via verbatim DB error messages greatly improves attacker efficiency
    2. Path information is useful to the attacker for OS fingerprinting, directory traversal attempts
    3. Other miscellaneous stack trace information is useful to an attacker to understand how the application works
    Is there anyway this can be surpressed so that the adapter does not show this information in the returned error message - see example message below ?
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema MaintenanceOrderByIDQuery_sync.xsd not found in E:\usr\sap\DPI\DVEBMGS40\j2ee\cluster\server0\validation\schema\f7cd3b50a87411e08830ed9d0af006a5\urnstw.contractor.wfm.workorderretrieval\MaintenanceOrderByIDQueryRequest_Out\httpsap.comxiSAPGlobal20~Global\MaintenanceOrderByIDQuery_sync.xsd  (validation\schema)
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1041)
         at sun.reflect.GeneratedMethodAccessor497.invoke(Unknown Source)
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: Schema Schema1.xsd not found in E:\usr\sap\DPI\DVEBMGS40\j2ee\cluster\server0\validation\schema\f7cd3b50a87411e08830ed9d0af006a5\urnstw.contractor.wfm.workorderretrieval\MaintenanceOrderByIDQueryRequest_Out\httpsap.comxiEA-APPLSEGlobal\Schema1.xsd  (validation\schema)
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1041)

    Hi,
    We are having the same problem, so you are not alone.
    I had an extensive call with Azure premium support and we where able to determine that:
    - Nothing is missing or in the wrong place in my exported .xml file.
    - Any changes to the VNET's using the web gui interface of https://manage.windowsazure.com is not possible when you have dns servers and use an gateway
    - You can download the .xml configuration file of the network and make manual changes to it, then import it again , to add/remove dns servers and or subnet's. 
    I am currently waiting for an solution,  i have let them lower the urgency from A to B (because i can make changes trough xml) and responded to the next support contact (saying he will continue with the issue) that the problems seems to be with azure and
    he should speak with the previous person helping me.  I have not heard from Azure support since.
    SR Number:115021812414226
    Open on:02/18/2015 09:28
    > There are networks with and without gateways created and the issue is happening on all the networks.
    > We are unable to add or remove the DNS servers. (by web gui)
    > Also not able to add or remove any subnets. (by web gui)
    > Every time the error message is same but the DNS server name is different. (from another subnet then the one we are changing)
    > Created CRI- 3405931, but they said it will need WATS team.
    > Confirmed with WATS engineer as well and moving case to WATS.
    > Cx agreed to lower the severity of the case as they are able to make changes through the network configuration file.
    > But they still want to get this resolved soon.
    > Agreed and dropped off, reducing severity to B 24/7.
    I hope microsoft is going to resolve this soon, as i do not want to edit my xml for little things like adding a subnet all the time. I have requested an status update in the issue.
    Should anyone have more information on this, please share it here.

  • In PI how do I convert the XML payload (input) to a text file and send out

    I am extracting data from SAP and sending thru XI / PI to a file (non-sap system).
    On the receiving end, I need the file to be a text file, with one row for each "FTZ_Row concatenated_data" tag in the input.  It needs to be just a plain text file with no XML tags.
    Currently the file gets one record which matches exactly to the XML payload below.
    I want it to create a file that looks like this :
               CONCATENATED DATA 1
               CONCATENATED DATA 2
                012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12
    here is the payload going thru XI
      <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
      <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
      <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
      <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
      </n0:FTZ_Concatenated_Row>
    thanks
    jay

    thanks for the input but I am still having issues - I get an empty file when I use the content conversion option.
    My payload coming into XI is :
            <?xml version="1.0" encoding="utf-8" ?>
    - <n0:FTZ_Concatenated_Row xmlns:n0="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" xmlns:prx="urn:sap.com:proxy:FI0:/1SAI/TAS0C0412CDBC3E782D0219:700:2008/06/25">
    <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    <FTZ_Row concatenated_data="CONCATENATED DATA 2" />
    <FTZ_Row concatenated_data="012345678912345678MAKTX-TEST LB 123123123123 01/02/2009 Z001WCHA9876543210.12" />
    </n0:FTZ_Concatenated_Row>
    Here is the layout of my data type - I am using the same for input & output
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone" targetNamespace="http://intel.com/xi/INTEL_PROCUREMENT/ForeignTradeZone">
       <xsd:complexType name="FTZ_Concatenated_Row">
          <xsd:sequence>
             <xsd:element name="FTZ_Row" maxOccurs="unbounded">
                <xsd:complexType>
                   <xsd:attribute name="concatenated_data" type="xsd:string" />
                </xsd:complexType>
             </xsd:element>
          </xsd:sequence>
       </xsd:complexType>
    </xsd:schema>
    I mapped these items :  FTZ_Concatenated_Row & FTZ_Row & concatenated_data
    I set up my content convesion with :
      recordset structure   FTZ_Row
    FTZ_Row.fieldSeparator     #
    FTZ_Row.endSeparator     'nl'
    I am not sure why the following row looks like this ??
        <FTZ_Row concatenated_data="CONCATENATED DATA 1" />
    I thought FTZ_Row would be one tag and "concatenated_data" would be another one.
    any help would be appreciated.
    I have read many entries/blogs/etc in SDN but and tried many different setups, but nothing is working.
    thanks

  • B2B-51507 - Payload Validation Error - while creating  VDA -4913V3

    I created a document definition under Positional Flat file for VDA-> 4913V4. I created ecs file using the Document editor and created the xsd. I used both these files in creating the Document definition. In the document definition, under identification tab, I have these values.
    Identification Value -> empty
    Identification Start Position -> 0
    Identification End Position -> 128
    And I created a Partner Agreement using this Document Definition. I created a channel to send the document to GXS Mailbox.
    In the agreement if I have both Validate and Translate checked on, I am getting an error which is show in the reports->Business Message.
    Error Code B2B-51507
    Error Description Machine Info: (RRDV2SOA) Description: Payload validation error.
    Error Level ERROR_LEVEL_COLLABORATION
    Error Severity ERROR
    Error Text Payload validation error.
    If I have only Translate checked on, I am not getting any error, but the message that is sent to GXS is zero bytes.
    If I leave both Validate and translate unchecked, the xml is sent to GXS but not the native Format.
    I took the payload from the business message and validated and it looks correct.
    I am using the sample data that is already validated in the B2B Document Editor using Data Analyzer.
    Can you help me on this. I am not sure what I am doing wrong. If needed I can send you the ecs, xsd, and B2B partner definition export zip file to your email address.
    Here is the logfile for this error.
    [2011-04-06T21:00:41.652-07:00] [soa_server1] [TRACE] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@1a33f088] [userId: <anonymous>] [ecid: 0000Iwi7c0MCcpiF_7I7S61DVcAD0051W4,0] [SRC_CLASS: oracle.tip.b2b.system.DiagnosticService] [APP: soa-infra] [dcid: 4e45f5dff566a29f:-335a9823:12eb62ea520:-7ffd-000000000000008c] [SRC_METHOD: synchedLog_J] oracle.tip.b2b.msgproc.ToplinkHelper: updateObject: Exit
    [2011-04-06T21:00:41.653-07:00] [soa_server1] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@1a33f088] [userId: <anonymous>] [ecid: 0000Iwi7c0MCcpiF_7I7S61DVcAD0051W4,0] [APP: soa-infra] [dcid: 4e45f5dff566a29f:-335a9823:12eb62ea520:-7ffd-000000000000008c] Error -: B2B-51507: Payload validation error.: Error -: B2B-51507: Payload validation error.[[
    at oracle.tip.b2b.document.pff.PFFDocumentPlugin.processOutgoingDocument(PFFDocumentPlugin.java:835)
    at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1326)
    at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:837)
    at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1411)
    at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:781)
    at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3319)
    at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2948)
    at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:575)
    at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused by: Error -: B2B-51507: Payload validation error.
    at oracle.tip.b2b.document.pff.PFFDocumentPlugin.processOutgoingDocument(PFFDocumentPlugin.java:798)
    ... 11 more
    Error -: B2B-51507: Payload validation error.
    at oracle.tip.b2b.document.pff.PFFDocumentPlugin.processOutgoingDocument(PFFDocumentPlugin.java:798)
    at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1326)
    at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:837)
    at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1411)
    at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:781)
    at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3319)
    at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2948)
    at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:575)
    at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Error -: B2B-51507: Payload validation error.: Error -: B2B-51507: Payload validation error.
    at oracle.tip.b2b.document.pff.PFFDocumentPlugin.processOutgoingDocument(PFFDocumentPlugin.java:835)
    at oracle.tip.b2b.msgproc.Request.outgoingRequestPostColab(Request.java:1326)
    at oracle.tip.b2b.msgproc.Request.outgoingRequest(Request.java:837)
    at oracle.tip.b2b.engine.Engine.processOutgoingMessageImpl(Engine.java:1411)
    at oracle.tip.b2b.engine.Engine.processOutgoingMessage(Engine.java:781)
    at oracle.tip.b2b.engine.Engine.handleMessageEvent(Engine.java:3319)
    at oracle.tip.b2b.engine.Engine.processEvents(Engine.java:2948)
    at oracle.tip.b2b.engine.ThreadWorkExecutor.processEvent(ThreadWorkExecutor.java:575)
    at oracle.tip.b2b.engine.ThreadWorkExecutor.run(ThreadWorkExecutor.java:214)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:105)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
    Caused by: Error -: B2B-51507: Payload validation error.
    at oracle.tip.b2b.document.pff.PFFDocumentPlugin.processOutgoingDocument(PFFDocumentPlugin.java:798)
    ... 11 more
    Thank you
    Krishna.

    I selected the option "Save guideline before exporting". I am guessing it is failing on the main element of the xml message because of some namespace issue. I am generating the XML using xsl transformationin BPEL and sending the XML payload to B2B Service.
    Is there a way to know what part of the XML is erroring duing the validation on the server. The error message is not helpful even I turned on Trace 32 level.
    Any ideas?
    Thank you
    Krishna

  • Reading XML payload from text file

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

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

  • Namespace in XML Payload for HTTP Sender

    Hello,
    I have just configured my snychronous HTTP <--> RFC Scenario. When I want to test it with some XML payload in the HTTP testing tool I get a mapping runtime exception.
    After some investigation using the test tab in the message mapping I realized that missing namespace in the XML payload caused the error. I tried to add manually a namespace to the XML and then it worked
    This is very strange I though that the namespace of the sender interface is automatically added to the XML payload?
    Do you have any information on this?

    Hi,
    U need to copy the payload from Message mapping test message tab and use that payload.
    or u can use the HTTP test client for testing the same.
    sample HTML code to create HTTP Client:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/66dadc6e-0a01-0010-9ea9-bb6d8ca48cc8
    You can also use the Wfetch application by Microsift for the same..
    download the same from below link
    http://www.iisfaq.com/Default.aspx?tabid=2975
    Thnx
    Chirag

  • XML payload search in Xi messages

    Hi All,
    I need to get the XML pay load for a message which contains a specific value for a specific field. Also I need to get the XML message ID of this message. Is there any option available in Xi for this purpose?
    Thanks in advance..

    Hi,
    sure it is but you need to use trex search engine for that
    http://help.sap.com/saphelp_nw04/helpdata/en/43/6030fae92f5f87e10000000a1553f6/content.htm
    once you configure trex you will
    be able to search for XML payload from RWB
    (runtime workbench of XI)
    this is the first - fast way
    there are also some non standard ways
    but these are pretty slow and if you have many messages
    they will not be very efficient in use:
    /people/alessandro.guarneri/blog/2006/02/14/super-message-monitor-for-sap-xi
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Xml payload encoding from utf to iso

    Hi Experts,
    Could you please let me know how can I encode he xml payload from utf-8 to ISO-8859-1.
    its bit urgent any help is appreciated.
    Thanks & Regards,
    Ranganath.

    Hi Ranganath,
    Here is the java mapping for PI 7.1 and above which will transform encoding type from utf-8 to ISO-8859-1.
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class addAttributeToTag2 extends AbstractTransformation {
          * @param args
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // TODO Auto-generated method stub
              try
                   int c;
                   int count=0;
                   String s="";
                   while(1>0)
                        c=in.read();
                        if(c<0)
                             break;
                        if(count<=2 && (char)c=='?')
                             count++;
                        if(count<=2)
                             s=s+(char)c;
                             if(count==2)
                                  s=s.replaceAll("utf-8","ISO-8859-1");
                                  s=s.replaceAll("UTF-8","ISO-8859-1");
                                  count=3;
                                  out.write(s.getBytes());
                             continue;
                        out.write(c);
                        //System.out.print((char)c);
                   in.close();
                   out.close();
              catch(Exception e)
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   addAttributeToTag2 genFormat=new addAttributeToTag2();
                   FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\copy.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\copy1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
         public void transform(TransformationInput arg0, TransformationOutput arg1)
                   throws StreamTransformationException {
              this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
    if you are working in PI 7.0 the you need following code
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    public class addAttributeToTag2 implements StreamTransformation {
          * @param args
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // TODO Auto-generated method stub
              try
                   int c;
                   int count=0;
                   String s="";
                   while(1>0)
                        c=in.read();
                        if(c<0)
                             break;
                        if(count<=2 && (char)c=='?')
                             count++;
                        if(count<=2)
                             s=s+(char)c;
                             if(count==2)
                                  s=s.replaceAll("utf-8","ISO-8859-1");
                                  s=s.replaceAll("UTF-8","ISO-8859-1");
                                  count=3;
                                  out.write(s.getBytes());
                             continue;
                        out.write(c);
                        //System.out.print((char)c);
                   in.close();
                   out.close();
              catch(Exception e)
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   addAttributeToTag2 genFormat=new addAttributeToTag2();
                   FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\copy.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\copy1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
    However as Krish has pointedf out file adapter has option to set encoding type, you can try that option first.
    regards
    Anupam

  • XML Payload does not have namespace and prefix.

    Hello
    I have created a consumer business service which will be called from JDEdwards EOne, pulls data from database and send it to Fusion Middleware.
    SO, I have created proxy using JAX-WS option. And suggested in oracle doc, I created proxy outside OMW and then copied it to my project. XML payload is getting generated without namespace and prefix. After some research, I modified package-info.java. Now, I am able to send the payload and if test it locally from Jdeveloper and take xml output using marshaller I can see it has namespace and prefix as well. BUt, when I run this from server it does not have namespace and prefix.
    Please help.
    Thanks
    TK

    Hi Naresh,
    The "rejectedMessage" property is for 10G, I am not 100% sure about its implementation in 11G.
    In 10G the faulted XML file moves to this location "Oracle_Home\bpel\domains\domain_name\jca\project_directory\rejectedMessages".
    This property is used to move the files which are not valid XML or which are not schema compliant. For DB polling I don't think this property is used.
    -Yatan

  • Xml payload in a single field

    Hi All,
    I hve a scenario like this ERP->XI->Monitoring system
    In the mapping, I need to assign the outbound payload (whole xml) to a field in the target
    message field since the (Target) Monitoring system wants to receive the whole xml message in single field.
    How can i achieve this?
    Thanks
    Deno

    try this.. some of the imports are not required.. however I just copied from my code..
    import javax.ejb.CreateException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import com.sap.aii.af.mp.module.Module;
    import com.sap.aii.af.mp.module.ModuleContext;
    import com.sap.aii.af.mp.module.ModuleData;
    import com.sap.aii.af.mp.module.ModuleException;
    import com.sap.aii.af.ra.ms.api.Message;
    import com.sap.aii.af.service.trace.Trace;
    import java.util.Hashtable;
    //XML Parsing and Transformation classes
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.io.InputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.StringWriter;
    import com.sap.aii.af.ra.ms.api.XMLPayload;
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    import javax.xml.transform.*;
    import javax.xml.transform.Source;
    import javax.xml.transform.Result;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;     
    Object obj = null; //Handler to get principal data
              Message msg = null;// Handler to get message object
              String getXMLtoField = null;
              try {
                   obj = inputModuleData.getPrincipalData();
                   msg = (Message)obj;
                   XMLPayload xmlpayload = msg.getDocument();
                        DocumentBuilderFactory factory;
                        factory =DocumentBuilderFactory.newInstance();
                        DocumentBuilder builder = factory.newDocumentBuilder();
                        // parse the XML Payload
                        Document document = builder.parse((InputStream)
                        xmlpayload.getInputStream());
                        OutputFormat format = new OutputFormat(document);    // Serialize DOM
                        StringWriter stringOut = new StringWriter();    // Writer will be a String
                        XMLSerializer serial = new XMLSerializer(stringOut, format);
                        serial.asDOMSerializer();                       // As a DOM Serializer
                        serial.serialize(document.getDocumentElement());
                        String FileContent = stringOut.toString();
              return getXMLtoField;

  • Unable to transform EDI document to XML payload in Oracle B2B inbound op

    Hi,
    In our current project we would be implementing Oracle B2B.So I am doing simple POC on Oracle B2B inbound operation for a EDI document for a project requirement.Facing issue if Transformation option selected in Oracle B2B console. Would really appreciate if you guys give me some pointer..
    Below is short desacription of POC:
    1) Created ECS file for Purchase Order(EDI_X12 Standard, 850, Version : 4010) in Spec Builder 6.6.0
    2) Created corresponding XSD and dummy test EDI data file(.dat) in Spec Builder 6.6.0
    3) In Oracle B2B Console, created Document Type and Document Definition
    4) Created 2 Trading Partners : Our Organisation(Host) and MyPartner(Remote)
    5) My Partner is Sender and Our Organisation is Receiver
    6) Linked Document Type to both Trading Partners
    7) Created a Listening Channel
    8) Protocol of Listening Channel is Generic File
    9) Mentioned Folder Path and File Type : %From PARTY%_%TO PARTY%_%DOCUMENT TYPE NAME_%DOCUMENT REVISION%.dat
    10) Agrrement validated and deployed
    11)Checked option Transformation for Agreement
    12) In SOA Composite created a simple Asynchronous BPEL process
    13) BPEL process using a B2B Adapter is subscribed to Document Type(Purchase Order) operatioon Receive and Mode Default
    14) Using a simple Assiign activity to map payload
    15) BPEL then inoke a File Adapter service to write sme XML payload(picked from B2B fatre EDI transformed to XML) to a file
    Issue Faced:
    1) B2B could make oput Sender and Receiver Trading Partners
    2) B2B could make out the Agrrement
    3) B2B is picking up EDI file
    4) If Agreemnet has Transformation option selected, then B2B is givinng below Error:
    [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@182461f] [userId: <anonymous>] [ecid: 0000JILzvC2E0Va_xLp2iW1EzqZ_0000pg,0] [APP: soa-infra] [dcid: 162dbcacafdb4641:19e705e4:13495b34174:-7fd3-0000000000000070] java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createN2XNative()Lcom/edifecs/xengine/xeobjects/XEDataProc
    at com.edifecs.xengine.xeobjects.XEHelper.createN2XNative(Native Method)
    5) It is unable to transfer EDI payload to XML
    6) Checked payload in Wire Message : still showing EDI payload
    7) Due to this BPEL is facing issue since it is expecting XML payload
    8) In BPEL it is givimng Error: Index Out Of bound.. I guess may be due to EDI payload
    9) If transformation option unchecked in Agreement in B2B console then B2B working good but BPEl failing
    Options Tried:
    1) I Exported Repository,then purged design time data and Reimported and restarted Server and tested..not working
    2) I also created a Parser Scehma for Blank EDI document(that option I found in Spec Builder 6.6.0==>New Document-->Parser Schema(Blank EDI Document) and then placed that Parser Schema file(ECS file) in folder :
    C:\Oracle\Middleware\Weblogic\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\config\schema
    and added an entry in XERegistry.xml
    <Item Name="SchemaFile">${XERoot}/config/schema/Spec2</Item>
    but not working..
    3) Checked namespace in XSd and WSDl for BPEL,they are correct
    Getting no clue how to resolve..Need help...
    Thank you...

    Log File :(Weblogic JDK pointing to 32 bit)
    [2012-01-01T01:32:01.818+05:30] [AdminServer] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@182461f] [userId: <anonymous>] [ecid: 0000JILhj4XE0Va_xLp2iW1EzqZ_00002J,0] [APP: soa-infra] [dcid: 162dbcacafdb4641:19e705e4:13495b34174:-7fd3-0000000000000070] java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createN2XNative()Lcom/edifecs/xengine/xeobjects/XEDataProc;[[
         at com.edifecs.xengine.xeobjects.XEHelper.createN2XNative(Native Method)
         at com.edifecs.xengine.xeobjects.XEHelper.createN2X(Unknown Source)
         at oracle.tip.b2b.document.edi.EDIDocumentPlugin.processIncomingDocument(EDIDocumentPlugin.java:1112)
    java.lang.UnsatisfiedLinkError: com.edifecs.xengine.xeobjects.XEHelper.createN2XNative()Lcom/edifecs/xengine/xeobjects/XEDataProc;
         at com.edifecs.xengine.xeobjects.XEHelper.createN2XNative(Native Method)
         at com.edifecs.xengine.xeobjects.XEHelper.createN2X(Unknown Source)
         at oracle.tip.b2b.document.edi.EDIDocumentPlugin.processIncomingDocument(EDIDocumentPlugin.java:1112)
         at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2348)
         at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1533)
    [2012-01-01T01:32:01.834+05:30] [AdminServer] [ERROR] [] [oracle.soa.b2b.engine] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@182461f] [userId: <anonymous>] [ecid: 0000JILhj4XE0Va_xLp2iW1EzqZ_00002J,0] [APP: soa-infra] [dcid: 162dbcacafdb4641:19e705e4:13495b34174:-7fd3-0000000000000070] java.lang.IndexOutOfBoundsException: Index: 0, Size: 0[[
         at java.util.ArrayList.RangeCheck(ArrayList.java:547)
         at java.util.ArrayList.get(ArrayList.java:322)
         at oracle.tip.b2b.engine.Engine.processIncomingMessageImpl(Engine.java:2746)
         at oracle.tip.b2b.engine.Engine.processIncomingMessage(Engine.java:1533)
    [2012-01-01T01:32:01.846+05:30]
    ]]

  • Testing XML Payload of Message Mapping in RWB

    Hi All,
    Is there any way where we can test the XML payload of Message Mapping bypassing the usual testing of messages thorugh IE .
    What i mean here is passing tge XML payload of Message Mapping directlyy to Adapter Engine...
    Regards
    Vinay P.

    Hi Vinay
    As said above
    You can use Testing the Runtime feature to do this task
    RWB -> Component Monitoring -> Integration engine Test tab
    You can also use this feature for Adapter engine and J2SE adapter - File & JDBC
    http://help.sap.com/saphelp_nw70/helpdata/EN/33/b99eebd9261b4886d6f6a354b8dcdf/content.htm
    Follow michal blog give above for screen shots
    Thanks
    Gaurav

Maybe you are looking for

  • Disabled pop-up blocker but pop-ups are still being blocked. How can I remedy this?

    I have disabled the pop-up blocker, I've added the site to the exceptions list but pop-ups are still being blocked. I have an email program that requires pop-ups in order to compose an email.

  • Pages dont show up on web the way I saved them

    Hello, I'm fairly new to using IWEB. So far Ive created a site and have published it to my desktop and uploaded it using cyberDuck to web. At first all was OK. Recently I made some changes to some pages, I uploaded the new pages which supposedly over

  • Weird Problem with BLOB CMP field

    Hi, I am trying to deploy an EJB2.0 CMP Bean in Weblogic6.1 .The Bean has one of the CMP Field as a serializable object mapped to a BLOB Datatype in Oracle8i When i try to creae this Entity Bean I get "java.io.IOException: ORA-22920: row containing t

  • Multiple transaction types

    Hi all, I am working on SRM 5.0 and ECC 6.0. Implementing extended classic scenario. 1.] Can someone tell me how to create multiple transaction types for SC which result in PO's in SRM?E.g ACPO; EMPO etc 2.]Further,when users create shopping cart, th

  • Enterprise Service Design Guide

    Hello, One of my colleagues is attending TechEd in Amsterdam this week, and he informs me that he was told SAP a while back developed a design guide for creating enterprise services.  I can't seem to find anything particular to this on SDN.. can some