# characters in payload

Hi All,
I am trying to retrieve xml payload hrough abap program.But , some times i am getting multiple # symbols and spaces between XML tags and i cant see these characters in SXMB_MONI.What could be the error?
Thanks
--Pradeep

Do you think that your ABAP program could be sending some special characters? If yes, then it may be required that you make your RFC destination at sender side as Unicode.
Regards,
Prateek

Similar Messages

  • Junk Characters #38: in payload.

    Hi All,
    To handle special characters in Payload I have implemented JAVA Mapping to convert & to %amp;
    and end to end ingterface it is working successfully, however i have observed that in the result payload #38; is occuring everytime after the &.  any inputs how to avoid this??
    exmanple:
    Vendor Name:  ABC & XYZ
    after mapping it is coming as ABC & XYZ
    I tried avoiding spaces between vendor name also but no luck.
    any inputs around this please...
    Thanks.

    > To handle special characters in Payload I have implemented JAVA Mapping to convert & to %amp;
    >
    > and end to end ingterface it is working successfully, however i have observed that in the result payload #38; is occuring everytime after the &.  any inputs how to avoid this??
    when you use SOAP adapter, the adapter changes & amp ; to & #38 ;
    But this should not be an isue, as both are representations of the same valus.

  • How to Handle Special Characters in PI7.1

    Hi Team,
    I need to handle some special characters like <,>,& etc.. from WS Adapter to CRM in PI 7.1.
    http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken]
    By using the above blog i had implemented the Java Code as
    public void execute(InputStream in, OutputStream out){
    try{
    int read_data;
    while((read_data = in.read()) != -1){
    if (read_data == '&'){
    out.write("&amp;".getBytes());
    }else if (read_data == '>'){
    out.write("&gt;".getBytes());
    }else if (read_data == '<'){
    out.write("&lt;".getBytes());
    }else if (read_data == '/'){
    out.write("&frasl;".getBytes());
    }else if (read_data == '\''){
    out.write("&apos;".getBytes());
    else { out.write(read_data);
    out.flush();
    } catch (Exception e){}
    I had added this class file in Operational Mapping.
    It is working  if we have only one IF condition for & in while
    Any suggestion
    Thanks
    Sriram

    Hi Ramesh,
    Thanks for your inputs, I have tried your code but it is not working. The error message stays the same.
    Dear Stephane,
    To describe the error more, the requirement is the payload coming from source through WS Adapter consists of the special characters <, > , & which are basic sematics of XML syntax. I need PI to process this payload with special characters and successfully transfer it to target CRM system. I have created the Java class with code (ref: Blog 9420) as stated earlier and added this class to my existing Operation Mapping. I am expecting the java mapping to replace the special characters in payload like  < with "&gt;" . So as the case with the other characters >,&,'
    After activaton of my operation mapping, I triggered the test message with Soap UI client and I could able to get a successful mapping only When I put the logic for &ampersand symbol only. However when I am trying to add the logic for > or < or ' the mapping is failing . I am using UTF-8 encoding across the source and PI enviroments.
    Sample SOAP message :
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:abcabca.com">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:MT_ABCDEFG_Req>
         <activity>
              <id/>
              <type>ZEMA</type>
              <actionType>C</actionType>
              <firewall>10000003</firewall>
              <subject>small &gt; &lt; attachment test</subject>
              <location/>
              <startDate>2010-07-08T10:53:31.000Z</startDate>
              <endDate>2010-07-08T10:53:31.000Z</endDate>
              <mainClient>1000319</mainClient>
              <mainContact>1000003</mainContact>
              <isConfidential>false</isConfidential>
              <summary/>
              <fullText>test body  - small.txt</fullText>
              <owner>1000021</owner>
              <from>ABCDEDF</from>
              <sendTo>emailaddress</sendTo>
              <copyTo/>
              <keywords/>
              <referenceId/>
              <createdBy>1000021</createdBy>
              <additionalContacts/>
              <additionalClients/>
              <additionalParticipants/>
              <status>A0008</status>
              <attachments>
                   <fileUrl>20100708110053-XXXXXXXXX</fileUrl>
                   <fileName>small.txt</fileName>
              </attachments>
              <attachments>
                   <fileUrl>20100708110053-XXXXXXXXX</fileUrl>
                   <fileName>EMail 2010-07-08.pdf</fileName>
              </attachments>
         </activity>
          </urn:MT_ABCDEFG_Req>
       </soapenv:Body>
    </soapenv:Envelope>
    Output on the SOAP UI  client for the above request:
    <!--see the documentation-->
    <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP:Body>
          <SOAP:Fault>
             <faultcode>SOAP:Server</faultcode>
             <faultstring>Server Error</faultstring>
             <detail>
                <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
                   <context>XIAdapter</context>
                   <code>ADAPTER.JAVA_EXCEPTION</code>
                   <text>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIServer:NO_MAPPINGPROGRAM_FOUND:
         at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1160)
         at sun.reflect.GeneratedMethodAccessor342.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(
    What do you think where I am doing the wrong?
    Sriram

  • Cyrillic characters issue in ABAP mapping

    Hello Experts,
    I am using ABAP mapping program to convert IDOC XML to flat file. Further i am using FIle adapter to write this file on FTP server.
    My problem is:
    When Idoc contains CYRILLIC characters in payload, then these characters appear as "#" after the mapping has executed.
    If I check in SXMB_MONI in XI, the inbound payload displays data correctly. In "Request Message mapping" node, if I check the output of ABAP mapping program, then cyrillic characters are replaced with "#". The same "#" is then written to File.
    Do you have any idea, how do i deal with this problem.
    NOTE: I tried passing encoding type = UTF-8 to the function - SCMS_STRING_TO_XSTRING which is used the mapping program to set the encoding type, but it did not work.

    @PI Expert: I tried to debug the ABAP mapping using SXI_MAPPING_TEST transaction, however when I paste my payload in the editor, the cyrillic characters appear as junk characters. Due to this, in the output, these junk characters are appear as "#"
    @Sarvesh: I too initially thought that this could be problem with AL11, that it is not displaying the data correctly. However when I checked the "Request Message Mapping" node in SXMB_MONI, it showed "#" characters. Also the .csv file generated contains "#" only.
    Thanks for your time and response.

  • Handling Non-English characters in the payload

    Hi Gurus,
    We are currently facing an issue in XI with Non-English characters. When we are trying to process Non-English characters in the payload , they are getting converted in to Junk characters at the receiver end. This scenario inbound to SAP ( File to Idoc scenario ) . Is there a way that Non-English characters can be handled in XI.
    Regards,
    Nick

    Hi Nick,
    I have knowledge of some problems when showing some kind of chinese character when
    dusplaying XML messages. If it's the case, check notes:
    #1135671 - ITS HTML viewer: incorrect display of xml documents
    #1072127 - ITS HTML Control: xml file rendering problem
    With regards,
    Caio Cagnani

  • Special Characters in the payload

    Hi,
    We are receiving Payload from Source Service Provider with some special characters “ and � as shown below:
    “Maintenance Documentation      Libraryâ€? under “Transformer Bushings Surveyâ€?
    Those Special Characters are actually double quotes.
    “Maintenance Documentation      Library” under “Transformer Bushings Survey” .
    PI While reading the payload is taking it as a special character. JMS is the sender adapter we are using.
    Is there any way to handle this without writing any module or Java Mapping??
    Regards
    Srilatha

    Hi Srilatha,
    You can try to change the character encoding with the standard modules like this document point out: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?overridelayout=t…
    From my own experience it is more useful to have a general java mapping to avoid this problem and to use it in all the required scenarios-
    Regards.

  • OSB input payload with characters ' '  ' ' fails service invoke

    Hi,
    In OSB I am calling a USM service to search the contents. Created a Business Service out of USM Search WSDL and then a proxy service which calls the business service. When I am trying to test the service through SOAP UI with the below payload I get an error: *<faultstring>Error parsing the XML resource. The tag 'contains' has not been properly closed. Instead, the tag 'sear:queryText' was encountered.</faultstring>*
    and when I run the same payload through OSB test console get an error:
    The XML document is not well-formed:
    error: </sear:queryText> does not close tag <contains>.
    The same works in SOA Process but in OSB
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.stellent.com/Search/">
       <soapenv:Header/>
       <soapenv:Body>
          <ns1:AdvancedSearch>
             <ns1:queryText>(xIdcProfile<matches>`xxAB`)<AND>(x_ID<contains>`13-AZXX001-TST`)</ns1:queryText>
             <ns1:sortField>dInDate</ns1:sortField>
             <ns1:sortOrder>DESC</ns1:sortOrder>
          </sear:AdvancedSearch>
       </soapenv:Body>
    </soapenv:Envelope>Now if I replaced *<* with *&lt;* and *>* with *&gt;* it works fine.
    the below payload just works fine
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.stellent.com/Search/">
       <soapenv:Header/>
       <soapenv:Body>
          <ns1:AdvancedSearch>
             <ns1:queryText>(xIdcProfile&lt;matches&gt;`xxAB`)&lt;AND&gt;(x_ID&lt;contains&gt;`13-AZXX001-TST`)</ns1:queryText>
             <ns1:sortField>dInDate</ns1:sortField>
             <ns1:sortOrder>DESC</ns1:sortOrder>
          </sear:AdvancedSearch>
       </soapenv:Body>
    </soapenv:Envelope>But the consumers of this service pass the data in this format *(xIdcProfile<matches>`xxAB`)<AND>(x_ID<contains>`13-AZXX001-TST`)* only. How do I make sure OSB takes in this format payload and executes it properly.
    As the same thing works in Oracle SOA Process but in OSB it just chokes out. Any help is appreciated.
    Thanks

    Like others mentioned, the XML which your service consumer is sending is not a valid XML because of the special characters and you need to escape them.
    1. The best way is to ask the service consumer to send a proper XML with any special characters put in a CDATA section or escaped.
    2. If above is not possible, then you need to make sure that your first Proxy service which receives the message from service consumer is of Messaging type with text as input message format. AnyXML,AnySOAP or WSDL based services will error out because these types of services expect a proper valid XML document as input.
    So in the messaging type service, you read the input message as text and then use the fn-bea:inlined-XML() and fn-bea:serialize() functions or CDATA to create a valid XML from the text input and pass this XML to your business service.

  • JMS Null Characters being added to payload

    Hi.
    I have an application which produces jms messages to a queue.
    Every message I have created seems to have 4 NULL characters pasted onto the end of the payload.
    I am experiencing the same issue with deployed applications and those just connecting to the jms server from a different application outside of Netweaver.
    This has only just started happening, and everything was working ok before this happened - has anyone any pointers at all??
    Im very confused as to why this would happen.
    Update: It also only applies to BytesMessages as TextMessage is ok.
    Regards,
    Andrew
    Edited by: Andrew Morton on May 15, 2008 12:14 PM

    This is to do with the jms framework.
    The 2 ways to get the payload out of the message resulted in 2 different sizes of payload being delivered.

  • HTTP Payload contains invalid characters

    Hi all,
    we have a idoc - 2 - http scenario. the idoc xml will be directly routet through to the http receiver as simple payload. The http receiver told us after the successful processing, that the received payload was invalid.
    here is the payload example:
    Header      :
    'HOST' = '10.29.100.74:23005'
    'USER-AGENT' = 'Java/1.4.2_09'
    'CONTENT-TYPE' = 'application/octet-stream'
    'CONTENT-LENGTH' = '3286'
    'CACHE-CONTROL' = 'no-cache'
    'PRAGMA' = 'no-cache'
    'ACCEPT' = 'text/html, image/gif, image/jpeg, *; q=.2, /; q=.2'
    'CONNECTION' = 'keep-alive'
    Content      :
    Content-Length: 3286
    Content-Type: application/octet-stream
    ¼Ý t ¤ ...
    The marked character were added somewhere in the xi system. Any ideas where the problem could be?
    Thanks in advance
    Michael

    The characters before the xml declaration are unicode identifiers which are part of any unicode file.
    It should not lead to errors, but in this case the content-type should be application/xml
    Regards
    Stefan

  • "Error while parsing SOAP XML payload: no element found" received when invoking Web Service

    Running PB 12.1 Build 7000.  Using Easysoap.  Error ""Error while parsing SOAP XML payload: no element found" received when invoking Web Service".  This error does not appear to be coming from the application code.  Noticed that there were some erroneous characters showing up within the header portion of the XML ("&Quot;").  Not sure where these are coming from.  When I do a find within the PB code for ""&quot;" it gets located within two objects, whereas they both reference a "temp_xml_letter".  Not sure where or what temp_xml_letter resides???   The developer of this is no longer with us and my exposure to WSDL and Web Services is rather limited.  Need to get this resolved...please.
    This is the result of the search.  Notice the extraneous characters ("&quot;"):
    dar1main.pbl(d_as400_mq_xml)
    darlettr.pbl(d_email_xml)
    ---------- Search: Searching Target darwin for 'temp_xml'    (9:52:41 AM)
    ---------- 2 Matches Found On "temp_xml":
    dar1main.pbl(d_as400_mq_xml).d_as400_mq_xml:  export.xml(usetemplate="temp_xml_letter" headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0  template=(comment="" encoding="UTF-8" name="temp_xml_letter" xml="<?xml version=~"1.0~" encoding=~"UTF-16LE~" standalone=~"yes~"?><EmailServiceTransaction xmlns=~"http://xml.xxnamespace.com/Utility/Email/EmailService" ~" xmlns:imc=~"http://xml.xxnamespace.com/IMC~" xmlns:xsi=~"http://www.w3.org/2001/XMLSchema-instance~" xmlns:root=~"http://xml.xxnamespace.com/RootTypes~" xmlns:email=~"http://xml.xxnamespace.com/Utility/Email~" xsi:schemaLocation=~"http://xml.xxnamespace.com/Utility/Email/EmailService http://dev.xxnamespace.com/Utility/Email/EmailService/V10-TRX-EmailService.xsd~"><EmailServiceInformation><EmailServiceDetail __pbband=~"detail~"><ApplicationIdentifier> applicationidentifier </ApplicationIdentifier><AddresseeInformation><AddresseeDetail><Number> number </Number></AddresseeDetail></AddresseeInformation><EmailMessageInformation><Ema
    darlettr.pbl(d_email_xml).d_email_xml:  export.xml(usetemplate="temp_xml_letter" headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0  template=(comment="" encoding="UTF-8" name="temp_xml_letter" xml="<?xml version=~"1.0~" encoding=~"UTF-16LE~" standalone=~"yes~"?><EmailServiceTransaction xmlns=~"http://xml.xxnamespace.com/Utility/Email/EmailService" ~" xmlns:imc=~"http://xml.xxnamespace.com/IMC~" xmlns:xsi=~"http://www.w3.org/2001/XMLSchema-instance~" xmlns:root=~"http://xml.xxnamespace.com/RootTypes~" xmlns:email=~"http://xml.xxnamespace.com/Utility/Email~" xsi:schemaLocation=~"http://xml.xxnamespace.com/Utility/Email/EmailService http://dev.xxnamespace.com/Utility/Email/EmailService/V10-TRX-EmailService.xsd~"><EmailServiceInformation><EmailServiceDetail __pbband=~"detail~"><ApplicationIdentifier> applicationidentifier </ApplicationIdentifier><AddresseeInformation><AddresseeDetail><Number> imcnumber </Number></AddresseeDetail></AddresseeInformation><EmailMessageInformation><Ema
    ---------- Done 2 Matches Found On "temp_xml":
    ---------- Finished Searching Target darwin for 'temp_xml'    (9:52:41 AM)

    Maybe "extraneous" is an incorrect term.  Apparantly, based upon the writeup within Wiki, the parser I am using does not interpret the "&quot;"?  How do I find which parser is being utilized and how to control it?
    <<<
    If the document is read by an XML parser that does not or cannot read external entities, then only the five built-in XML character entities (see above) can safely be used, although other entities may be used if they are declared in the internal DTD subset.
    If the document is read by an XML parser that does read external entities, then the five built-in XML character entities can safely be used. The other 248 HTML character entities can be used as long as the XHTML DTD is accessible to the parser at the time the document is read. Other entities may also be used if they are declared in the internal DTD subset.
    >>>

  • Attach file to mail with "unusual" characters

    Hi
    I have made a procedure that can send mail with attached file/files. But when I attach a text file that contains characters like (Å, Ä or Ö) these characters gets like (A, A and ?) when I recieve the mail to my mail client. When I look at the file on the disk before I attach it the characters is OK but when I attach the file and mails it the characters get replaced. So why does the charaters get messed up when I attach the file to a mail??
    My procedure looks like this:
    procedure mail_files(from_name varchar2,
    to_name varchar2,
    subject varchar2,
    message varchar2,
    max_size number default 9999999999,
    filename1 varchar2 default null,
    filename2 varchar2 default null,
    filename3 varchar2 default null,
    debug number default 0) is
    mottagare VARCHAR2(2048) := to_name;
    v_smtp_server varchar2(32) := 'mail.telia.se';
    v_smtp_server_port number := 25;
    v_directory_name varchar2(100);
    v_file_name varchar2(100);
    v_line varchar2(1000);
    crlf varchar2(2) := chr(13) || chr(10);
    mesg varchar2(32767);
    conn UTL_SMTP.CONNECTION;
    type varchar2_table is table of varchar2(200) index by binary_integer;
    file_array varchar2_table;
    i binary_integer;
    v_file_handle utl_file.file_type;
    v_slash_pos number;
    mesg_len number;
    mesg_too_long exception;
    invalid_path exception;
    mesg_length_exceeded boolean := false;
    begin
    -- first load the three filenames into an array for easier handling later ...
    file_array(1) := filename1;
    file_array(2) := filename2;
    file_array(3) := filename3;
    -- Open the SMTP connection ...
    conn := utl_smtp.open_connection(v_smtp_server, v_smtp_server_port);
    -- Initial handshaking ...
    utl_smtp.helo(conn, v_smtp_server);
    utl_smtp.mail(conn, from_name);
    WHILE (mottagare IS NOT NULL) LOOP
    utl_smtp.rcpt(conn, get_element(mottagare));
    END LOOP;
    --utl_smtp.rcpt( conn, to_name );
    utl_smtp.open_data(conn);
    -- build the start of the mail message ...
    mesg := 'Date: ' || TO_CHAR(SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
    'From: ' || from_name || crlf || 'Subject: ' || subject || crlf ||
    'To: ' || to_name || crlf || 'Mime-Version: 1.0' || crlf ||
    'Content-Type: multipart/mixed; boundary="DMW.Boundary.605592468"' || crlf || '' || crlf ||
    'This is a Mime message, which your current mail reader may not' || crlf ||
    'understand. Parts of the message will appear as text. If the remainder' || crlf ||
    'appears as random characters in the message body, instead of as' || crlf ||
    'attachments, then you''ll have to extract these parts and decode them' || crlf ||
    'manually.' || crlf || '' || crlf ||
    '--DMW.Boundary.605592468' || crlf ||
    'Content-Type: text/html; charset=8859-1' || crlf ||
    'Content-Disposition: inline;' || crlf ||
    'Content-Transfer-Encoding: 8bit' || crlf || '' || crlf ||
    message || crlf;
    mesg_len := length(mesg);
    if mesg_len > max_size then
    mesg_length_exceeded := true;
    end if;
    utl_smtp.write_data(conn, mesg);
    --utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(mesg));
    -- Append the files ...
    for i in 1 .. 3 loop
    -- Exit if message length already exceeded ...
    exit when mesg_length_exceeded;
    -- If the filename has been supplied ...
    if file_array(i) is not null then
    begin
    -- locate the final '/' or '\' in the pathname ...
    v_slash_pos := instr(file_array(i), '/', -1);
    if v_slash_pos = 0 then
    v_slash_pos := instr(file_array(i), '\', -1);
    end if;
    -- separate the filename from the directory name ...
    v_directory_name := substr(file_array(i), 1, v_slash_pos - 1);
    v_file_name := substr(file_array(i), v_slash_pos + 1);
    -- open the file ...
    v_file_handle := utl_file.fopen(v_directory_name, v_file_name, 'r');
    -- generate the MIME boundary line ...
    mesg := crlf || '--DMW.Boundary.605592468' || crlf ||
    'Content-Type: application/octet-stream; name="' ||
    v_file_name || '"' || crlf ||
    'Content-Disposition: attachment; filename="' ||
    v_file_name || '"' || crlf ||
    'Content-Transfer-Encoding: 8bit' || crlf || crlf;
    mesg_len := mesg_len + length(mesg);
    utl_smtp.write_data(conn, mesg);
    -- and append the file contents to the end of the message ...
    loop
    utl_file.get_line(v_file_handle, v_line);
    if mesg_len + length(v_line) > max_size then
    mesg := '*** truncated ***' || crlf;
    utl_smtp.write_data(conn, mesg);
    mesg_length_exceeded := true;
    raise mesg_too_long;
    end if;
    mesg := v_line || crlf;
    utl_smtp.write_data(conn, mesg);
    mesg_len := mesg_len + length(mesg);
    end loop;
    exception
    when utl_file.invalid_path then
    -- All other exceptions are ignored ....
    when others then
    null;
    end;
    mesg := crlf;
    utl_smtp.write_data(conn, mesg);
    -- close the file ...
    utl_file.fclose(v_file_handle);
    end if;
    end loop;
    -- append the final boundary line ...
    mesg := crlf || '--DMW.Boundary.605592468--' || crlf;
    utl_smtp.write_data(conn, mesg);
    -- and close the SMTP connection ...
    utl_smtp.close_data(conn);
    utl_smtp.quit(conn);
    end;
    Any help is highly appreciated.
    Regards
    Nils

    Hi Madhu,
         Using the default modules PayloadSwapBean and MessageTransformBean you can able to send multiple attachments.
    swap.keyName  :payload-name or payload-description or content-type, content-description. swap.keyValue: If you have  a multiple attachments then give the multiple key value.
    Like you have payload name
      Attachment1, Attachment2 then
    swap.keyName  payload-name
    swap.keyValue  Attachment1, Attachment2
    Using the MessageTransformBean you can able to change the file name.
    PayloadSwapBean:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/2e/bf37423cf7ab04e10000000a1550b0/content.htm]
    MessageTransformBean:
    [http://help.sap.com/saphelp_nw70/helpdata/EN/57/0b2c4142aef623e10000000a155106/content.htm]
    Regards,
    Prakasu

  • Xml payload related problem

    Hi ALL
    Currently I am doing a scenario in which i m encrypting the incoming xml payload(field by field) in java mapping and then decrypting it with in the adapter module.Now problem that i m facing is that after encryption if i get some special characters, the resulting xml payload becomes invalid and will not be parsed.

    hi,
    Try to put it into CDATA.
    <script>
    <b><![CDATA[</b>!@!#!@#!@#!@$@#$<b>]]></b>
    </script>
    regards,
    Wojciech
    Message was edited by: Wojciech Gasiorowski

  • Extra header lines appearing in payload after singning and encrypting in Mail Receiver adapter PI 7.31

    Hi,
    We have a mail receiver adapter which is sending out a edi payload as attachment to the external receiver.
    When we send the normal .edi file it is ok.
    But when we sign and encrypt the payload and send it out, the external customer receiver decrypts and validates the message successfully but when their application tries to read the edi payload it finds the extra header lines as below :
      content-id:
    <[email protected]>
    Content-Disposition: attachment; filename=xxxxxxxx.edi Content-Type:
    application/xml
    At their end, their application (DataPower) expects the first three characters of the payload
    (decrypted payload) to be either UNA or UNB.This is how it validates whether the incoming message is an EDI message.
    But it encounters the extra MIME headers in the payload.
    Therefore it gets rejected by DataPower which thinks the content is an
    unknown message type.
    How to suppress the header lines appearing in the payload(after decryption and validation).
    Thanks,
    Guest

    hi,
    try content-type as "text/xml"

  • Java Mapping: payload as mail attachment and dynamic file name .

    Hi,
    I have written this piece of java code.
    The code includes XPATH for fetching dynamic filename and the copysource( in, out ) to copy the content of payload as mail attchment.
    The code seems to work fine, when either of the functionality is implemented.
    but when both are implemented together ie parsing for xpath then again parsing to copy payload, then it doesnt executes the latter path i.e the payload is not fetched in the attachment.
    public class MailPackage implements StreamTransformation {
      public void setParameter(Map map) {
      public void execute(InputStream in, OutputStream out)
              throws StreamTransformationException {
      String mailSubject = "test mail";
      String mailSender = "aaaaaaaa";
      String mailReceiver = "[email protected]";
      String attachmentName = null;
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
      factory.setNamespaceAware(false);
    factory.setValidating(false);
         try {
              builder = factory.newDocumentBuilder();
         Document doc = null;
          doc = builder.parse(in);
              String XPATH ="/*/Invoice/InvoiceHeader/InvoiceNumber/text()";
              Node fieldValueNode = org.apache.xpath.XPathAPI.selectSingleNode(doc,XPATH);
              System.out.print(fieldValueNode);
              attachmentName = fieldValueNode.getNodeValue() +".xml";
      String boundary = "--";
      String mailContent = "This is a sample file";
      String CRLF = "\r\n";
        //     create XML structure of mail package
        String output ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
               + "<ns:Mail xmlns:ns=\"http://sap.com/xi/XI/Mail/30\">"
               + "<Subject>" + mailSubject     + "</Subject>"
               + "<From>" + mailSender     + "</From>"
               + "<To>" + mailReceiver     + "</To>"
               + "<Content_Type>multipart/mixed; boundary=\"" + boundary + "\"</Content_Type>"
               + "<Content>";
        out.write(output.getBytes());
        // create the declaration of the MIME parts
        //First part
        output = "--" + boundary + CRLF
               + "Content-Type: text/plain; charset=UTF-8" + CRLF
               + "Content-Disposition: inline" + CRLF + CRLF
               + mailContent + CRLF
        //Second part
        + "--" + boundary + CRLF
        + "Content-Type: application/xml; name=" + attachmentName + CRLF
        + "Content-Disposition: attachment; filename=" + attachmentName + CRLF + CRLF;
        out.write(output.getBytes());
        //Source is taken as attachment
        copySource(in, out);
        out.write("</Content></ns:Mail>".getBytes());
      } catch (Exception ie) {
        throw new StreamTransformationException(ie.getMessage());
    protected static void copySource(InputStream in, OutputStream out)throws IOException {
        byte[] bbuf = new byte[in.available()];
        int bblen = in.read(bbuf);
       if (!(bblen < 0)) {
          String sbuf = new String(bbuf);
           //replace all control characters with escape sequences
         sbuf = sbuf.replaceAll("&", "&amp;");
         sbuf = sbuf.replaceAll("\"", "&quot;");
         sbuf = sbuf.replaceAll("'", "&apos;");
        sbuf = sbuf.replaceAll("<", "&lt;");
        sbuf = sbuf.replaceAll(">", "&gt;");
        out.write(sbuf.getBytes());
    Povide your suggestions.

    Hi,
    This is the sample o/p that I get by opening the mail attachment using notepad.
    <?xml version="1.0" encoding="UTF-8"?>
    <InvoiceTransmission><InvoiceTransmissionHeader><InvoiceCreationDate>2008-12-03T00:00:00</InvoiceCreationDate><Version>2.0.2</Version></InvoiceTransmissionHeader><Invoice><InvoiceHeader><CustomerEntityID>LH</CustomerEntityID><IssuingEntityID>009140559</IssuingEntityID><InvoiceNumber>913353669</InvoiceNumber><InvoiceIssueDate>2008-12-03</InvoiceIssueDate><InvoiceType InvoiceTransactionType="OR">INV</InvoiceType><InvoiceDeliveryLocation>aaa</InvoiceDeliveryLocation><TaxInvoiceNumber>Not Applicable</TaxInvoiceNumber><InvoiceCurrencyCode>USD</InvoiceCurrencyCode><InvoiceTotalAmount>517174.63</InvoiceTotalAmount><InvoiceIDDetails InvoiceIDType="BT"><InvoiceIDVATRegistrationNumber>0000000000</InvoiceIDVATRegistrationNumber><InvoiceIDName1>aaaaaaaaaaaaaaa</InvoiceIDName1><InvoiceIDName2>bbbbbbHKG</InvoiceIDName2><InvoiceIDCity>ccccccccc ccccc</InvoiceIDCity><InvoiceIDCountryCode>HK</InvoiceIDCountryCode></InvoiceIDDetails><InvoiceIDDetails InvoiceIDType="II"><InvoiceIDVATRegistrationNumber>0000000000</InvoiceIDVATRegistrationNumber><InvoiceIDName1>eeeeeeee</InvoiceIDName1><InvoiceIDName2>PAY BY WIRE TRANSFER</InvoiceIDName2><InvoiceIDCity>fffffffffffffff, NA</InvoiceIDCity><InvoiceIDCustomField ID="1"><InvoiceIDCustomFieldDescription>Company Registration Number</InvoiceIDCustomFieldDescription><InvoiceIDCustomFieldValue>0000000000</InvoiceIDCustomFieldValue></InvoiceIDCustomField></InvoiceIDDetails></InvoiceHeader><SubInvoiceHeader><InvoiceLine><ItemNumber>001</ItemNumber><ItemQuantity><ItemQuantityType>IN</ItemQuantityType><ItemQuantityFlag>GR</ItemQuantityFlag><ItemQuantityQty>28134.000</ItemQuantityQty><ItemQuantityUOM>USG</ItemQuantityUOM></ItemQuantity><ItemQuantity><ItemQuantityType>DL</ItemQuantityType><ItemQuantityFlag>GR</ItemQuantityFlag><ItemQuantityQty>106498.775</ItemQuantityQty><ItemQuantityUOM>LT</ItemQuantityUOM></ItemQuantity><ItemDeliveryReferenceValue ItemDeliveryReferenceType="DTN">590365</ItemDeliveryReferenceValue><ItemDeliveryReferenceValue ItemDeliveryReferenceType="!
    ARN">DAL
    CH</ItemDeliveryReferenceValue><ItemDeliveryReferenceValue ItemDeliveryReferenceType="FNO">mmmmmmmmm</ItemDeliveryReferenceValue><ItemDeliveryLocation>pppp</ItemDeliveryLocation><ItemReferenceLocalDate
    If you notice the problem is, the undesired "exclamation mark" that gets added in some fields before the actual value.
    In the above case.. look at "ItemDeliveryReferenceType="! ARN">DAL"
    the exclamation mark before value "ARN is unwanted, which leads to improper XML formation.
    Cant figure out why is this coming.
    Regards,
    Faria Mithani

  • Special characters in sender soap adapter provoke HTTP 500 error

    Hi,
    SAP R3 is sending a SOAP message to PI through SOAP adapter.
    When the payload does NOT contain german characters like ü, it works fine.
    However, when the payload DOES contain special characters, the SOAP adapter replies with an HTTP 500 code error.
    If I use SoapUI to send the soap message, and setting UTF-8 as the encoding in the program options, it will go through fine. If I change to ISO-8859-1 it will fail.
    I'm thinking in two options:
    - Make sure that SAP R3 sends the message in UTF-8 format (I think this is happening currently), as if SoapUI works, then probably R3 is not using UTF-8.
    - Force the adapter to use UTF-8. Is this possible? In the sender SOAP adapter I've added AF_Modules/MessageTransformBean (type local EB), and then Transform.ContentType for parameter name and --> text/plain;charset=utf-8 for parameter value. The sender adapter will fail then for every message, with or without special characters.
    Anyway, in this link (http://help.sap.com/saphelp_nwpi71/helpdata/EN/a4/f13341771b4c0de10000000a1550b0/frameset.htm) it seems to say that the sender soap adapter cannot be extended with modules, so maybe that's the reason why it fails when trying to add a module.
    Thanks

    If I use SoapUI to send the soap message, and setting UTF-8 as the encoding in the program options, it will go through fine. If I change to ISO-8859-1 it will fail.
    I'm thinking in two options:
    Check the use of option 1 ..... the URL which SAP is using to send the data can containe the encoding information.
    Check this SAP note: https://service.sap.com/sap/support/notes/856597
    From the above note:
    Q: What character encoding is supported by the SOAP sender adapter?
    +you can supply the encoding information with the xmlenc variable in the request URL as in+
    Regards,
    Abhishek.

Maybe you are looking for

  • Premiere CS4 problems with Snow Leopard 10.6.7

    I know that this is draging the depths of history but we have eight MackBook Pros with Snow Leopard (no roll back possible) and various CS4 progeams on in the college at which I teach.  We have a problem with Premiere in that clips will not play eith

  • Please post your root's .bashrc and .bash_profile. Mine is gone :-)

    Hi, Can someone post their stock .bashrc and .bash_profile files for the root user. I overwrote mine when messing around with the prompt.

  • Report to view GL currency____Urgent Please

    Hi All, My client want to view GL account wise balances, is there any report or T.code to ful fill this requirement. Best Regards, Boppana Moderator: Please, avoid asking urgent basic questions

  • Error while opening Quartz Composer

    Command: Quartz Composer Path: /Developer/Applications/Graphics Tools/Quartz Composer.app/Contents/MacOS/Quartz Composer Parent: WindowServer [91] Version: 2.1.1 (17.1) Build Version: 91 Project Name: QuartzComposerEditor Source Version: 170100 PID:

  • Reading audio input using dsnoop

    I have an app that can only run in Flash under Windows. I can get it to mostly work under WINE, but there are parts that need microphone input. Winecfg lists the writeable audio device as dmix:0, and the readable as dsnoop:0. Obviously the dmix:0 wor