Convert XML-String from Codepage utf-16 to ISO-8859-1
Hi to all experts,
our system is now unicode with codepage 4102 (UTF-16) and we do an Simple Transformation for creating an XML-String.
before UniCode : xml_data = <?xml version="1.0" encoding="iso-8859-1"?>#<transactionRequest userID=" .......
now with UniCode : xml_data = <?xml version="1.0" encoding="utf-16"?>#<transactionRequest userID=".......
The xml_data transfered to an external Sytem via HTTPS- Communication direct from ABAP.
The external Sytem send an Error Request:
<?xml version="1.0" encoding="ISO-8859-1"?>#<transactionResponse># <transactionErrorResponse># <errorResponse># <errorCode>SYS-0001</errorCode># <errorDescription>java.lang.Exception: null[ #<?xml version="1.................
Have you any idea
Thanks for your help!
Peter
Edited by: Peter Pforr on Sep 25, 2008 9:59 AM
Edited by: Peter Pforr on Sep 25, 2008 10:14 AM
Darshan,
Did you get an answer for this question? We have same requirement to create XML file in ISO-8859-1 format with Attributes is set to "Y" and CDATA is being used for data.
Can you please let me know if you still remember how did you achieve it?
Satyen...
Similar Messages
-
XML Encoding Issue - Format UTF-16 to ISO-8859-1
Dear Groupmates,
I have data in my Internal table which i am converting to XML using custom Transformation.
Data is going to third party.The third party system requires data in ISO-8859-1 Format but SAP is generating the same in UTF-16 Format.I have been able to change the format of file from
utf-16 to ISO-8859-1 format but after conversion i am getting invalid tag information in form of characters
like < , > etc..in my file.
Here is the code i have used to set the encoding to ISO-8859-1 :-
DATA: xmlout TYPE xstring.
DATA: ixml TYPE REF TO if_ixml,
streamfactory TYPE REF TO if_ixml_stream_factory,
encoding TYPE REF TO if_ixml_encoding,
ixml_ostream TYPE REF TO if_ixml_ostream.
ixml = cl_ixml=>create( ).
streamfactory = ixml->create_stream_factory( ).
ixml_ostream = streamfactory->create_ostream_xstring( xmlout ).
encoding = ixml->create_encoding(
character_set = 'ISO-8859-1' byte_order = 0 ).
ixml_ostream->set_encoding( encoding = encoding ).
Sample Output :-
<?xml version="1.0" encoding="iso-8859-1"?>
<AMS_DOC_XML_EXPORT_FILE><AMS_DOCUMENT AUTO_DOC_NUM="FALSE" DOC_CAT="CA" DOC_CD="CA" DOC_DEPT_CD="045" DOC_ID="XR10281060830400001" DOC_IMPORT_MODE="OE" DOC_TYP="CH" DOC_UNIT_CD ="NULL" DOC_VERS_NO="01">
<CH_DOC_HDR AMSDataObject="Y">
<DOC_CAT Attribute="Y"><![CDATA[CA]]></DOC_CAT>
<DOC_TYP Attribute="Y"><![CDATA[CH]]></DOC_TYP>
Please let me know if anyone has idea how i can get rid of the invalid tag information.
Thanks !
With Regards,
Darshan MulmuleDarshan,
Did you get an answer for this question? We have same requirement to create XML file in ISO-8859-1 format with Attributes is set to "Y" and CDATA is being used for data.
Can you please let me know if you still remember how did you achieve it?
Satyen... -
Hi All,
Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
My XML string starts like this
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
Thanks,
PavithraThanks Praveen. It worked.
However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
<?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
So there is an error in sxmb_moni. Is it possible to remove this. -
How to create XML string from BPM Business Object?
Hello,
I have a business object in my BPM project and I need to transform it in a XML string:
From:
Business Object: Customer
Properties: Name, Age
To:
"<Customer><Name>Robert</Name><Age>17</Age></Customer>"
How can I do this?
Thanks.Hello,
I have a business object in my BPM project and I need to transform it in a XML string:
From:
Business Object: Customer
Properties: Name, Age
To:
"<Customer><Name>Robert</Name><Age>17</Age></Customer>"
How can I do this?
Thanks. -
Special charecters handling while Converting XML string to DOM
Hi,
I am using the following approach for converting XML string to DOM, but due to Special characters like "&", I am getting Exceptions:
String xmlString;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xmlString)));
Can anyone please help me out on how to handle the Special characters in the above code.If the XML doesn't parse, then the XML must be invalid. Show a sample of such a special character in the XML data. Please use \ tags to post the actual XML content and any other code.
-
How to convert a string from upper case to lower case in FOX formula
Hi Experts,
How to convert a string from upper case to lower case in FOX formula?
Thanks,
Cheers!!!
PANKAJThe last result.append( c ) should be:
result.append( Character.toLowerCase(c) ); -
How to convert a string from lower case to upper case withour using transla
Hi all,
how to convert a string from lower case to upper case withour using translate,
Thanks in Advance,
ReddyRefer to this related thread
Re: hi guys this very urgent please help -
Hi all,
I have a question here regarding converting XML string into a DOM document.
How can I do this in Java?
The Document.Parse() methods do not have one that takes in String as its parameter.
I'm not sure what is the best way to do this in Java.
Any help is greatly appreciated.
Thank you in advance.
regards,
SeanConvert XML String to Document with StringReader.
String xmlString;
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xmlString))); -
Convert XML string into an abap format date and time
Hi,
Does anyone know of a method or a function module in ABAP which converts XML string into an abap format date and time.
Here is a part of the xml that I want to convert.
<ns2:EventDateTime>2009-07-02T10:13:45+10:00</ns2:EventDateTime>
<ns2:EventMessageTransmissionDateTime>2009-07-02T10:13:45.987+10:00</ns2:EventMessageTransmissionDateTime>
Currently EventDateTime and EventMessageTransmissionDateTime are type XSDDATETIME_Z and these are converted to proper dates and times. We will be changing these fields to a STRING instead of XSDDATETIME_Z. The reason for this is to make the field more versatile. The customer would be receiving dates with Zulu (2009-09-23T12:00:00Z), with offsets (2009-09-23T12:00:00+10:00/-10:00) and just local timestamp (2009-09-23T12:00:00). With this, we need to make the date fields as string
to be able to accept the various date formats (esp. the local timestamp).
I am looking for a standard function module or method that will convert the xml string to a proper date and time abap format.
Would appreciate anyone's help!
Thanks.
Edited by: eunice ocson on Jul 13, 2009 1:49 AM
Edited by: eunice ocson on Jul 13, 2009 1:50 AM
Edited by: eunice ocson on Jul 13, 2009 1:51 AM
Edited by: eunice ocson on Jul 13, 2009 1:51 AMHi Eunice
Use the FM 'SMUM_XML_PARSE'
for more info
[Convert XML string to ABAP|XML String to ABAP or GUI]
hope it helps you.
Thanks!! -
Sending long XML strings from a servlet
Hi,
I'm trying to send a long (16K) XML string from a Java servlet to a
MSXML2.XMLHTTP40 client. The client doesn't receive any data when the
string is longer than about 2K .
I am using the POST method.
I have tried increasing the buffer size on the sending side with
HttpServletResponse.setBufferSize() - this had no effect.
Any ideas ?
Thanks very much for your help,
RodLooks like the problem is on the client side (MSXML) because I can flawlessly send half-megs XML files from a Servlet to a browser or a java.net.URL
-
Mail Sender - Encoding (I need to change from UTF-8 to ISO-8859-1)
Hi,
I'm getting data from email (in ms exchange) using the Mail Sender Adapter.
In the e-mails exists characters as ç (ccedil), ã (atilde), õ (otilde) and others. The XI cannot read this characters because the encode in XML is UTF-8.
How I do to change the encode in XI from UTF-8 to ISO-8859-1 ?
Thank you!Unfortunately most mail server do not apply the codepage to the content type of a mail.
In this case you have to set the content type with help of the MessageTransformBean:
Transform.ContentType text/plain;charset="ISO-8859-1"
Regards
Stefan -
HTTP-Receiver: Code page conversion error from UTF-8 to ISO-8859-1
Hello experts,
In one of our interfaces we are using the payload manipulation of the HTTP receiver channel to change the payload code page from UTF-8 to ISO-8859-1. And from time to time we are facing the following error:
u201CCode page conversion error UTF-8 from system code page to code page ISO-8859-1u201D
Iu2019m quite sure that this error occurs because of non-ISO-8859-1 characters in the processed message. And here comes my question:
Is it possible to change the error behaviour of the code page converter, so that the error will be ignored?
Perhaps the converter could replace the disruptive character with e.g. u201C#u201D?
Thank you in advance.
Best regards,
ThomasHello.
I'm not 100% sure if this will help, but it's a good Reading material on the subject (:
[How to Work with Character Encodings in Process Integration (NW7.0)|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42]
The part of the XSLT / Java mapping might come in handy in your situation.
you can check for problematic chars in the code.
Good luck,
Imanuel Rahamim. -
Abap Proxy Convert UTF-8 to ISO-8859-1
Dear,
I have the following scenario:
Abap Proxy-> PI -> WebService.
I need to change the encondig UTF-8 to ISO-8859-1 when the SAP ECC sends data to the PI.
How do I do this?
I have a XSLT program that performs the this conversion, UTF-8 to ISO-8859-1, between PI and WebService.
Regards,
Sérgio SalomãTo understand more about Character Encoding in SAP Process Integration. You can refer the following link:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true -
I am using the Google Maps API, it return in utf-8,
so for some countries, caracters are wrong,
My server is ISO-8859-1
So, how to convert the result from utf-8 to iso-8859-1 ?
I tried :
<cfprocessingdirective pageEncoding="UTF-8">
<cfcontent type="text/html; charset=UTF-8">
<cfset setEncoding("URL", "UTF-8")>
<cfset setEncoding("FORM", "UTF-8")>
and
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
No change. always the wrong caracters,
Thanks for any help with this mess.
Pierre.I am using CF v7.
My server and CF are ISO-8859-1.
But I am using Google Maps API , which returns country names in UTF-8.
I tried the Google Maps directives, with adding parameter eo=ISO-8859-1 in the Google Key <script>,
same result.
Then I have to convert to ISO-8859-1 , at least in that page for country names.
(I have a specific problem with Thailande, Google Maps returns : Tha๏lande
and in the data base it writes : tha๏ ;lande (an Access database)
I answer to injun [576871] ,
Diificult to insert that code, because I am in a JavaScript code already.
So it will not accept <cfscript> again inside ? I will try.
Thanks for any help.
Pierre. -
Changing the xml encoding from UTF-8 to ISO-8859-1
Hi,
I have created an xml file in xMII transaction that I feed into a webservice as input. As of now, the data in the xml file is entirely english text (it would be changing to have European text soon). I gave the encoding as UTF-8.
I get an error on the webservice side(not xMII code) that the its not able to parse. The error is 'SaxParseException: Invalid 1 of 1-byte UTF-8 sequence). I know that an easy fix is if tI change the encoding to iso-8859-1.
But the reference document doesnot let me put anythign other than UTF-8. Even if I put <?xml version="1.0" encoding="iso-8859-1"?> as the first line, when I save it and open it back, i see <?xml version="1.0" encoding="UTF-8"?>
Is there any way to change the encoding? Or better still, anyway idea why this invalid sequence is coming from?
Thanks,
Ravi.Hi Ravi,
We have encountered scenarios where we needed to take the <?xml version="1.0" encoding="UTF-8"?> out completely. As xMII was providing the Web Service, it needed a workaround.
In your case, it seems that you wish to pass it from xMII to an external Web Service provider. One option might be to pass the XML document as string.
Once you convert it to a string, it may escape all XMl characters (i.e. '<' into '<'). You could perform a string manipulation and remove the <?xml version="1.0" encoding="UTF-8"?> from the string. You may also need to play around with xmlDecode( string ) function in the Link Editor.
I would suggest that before you try this option, create a string variable will the contents, but without the <?xml version="1.0" encoding="UTF-8"?> and try assigning it to the input.
You may also wish to try a string variable that has <?xml version="1.0" encoding="iso-8859-1"?> as the first line. If this works, you should be able to perform string manipulations to convert your XML document into this modified string.
Cheers,
Jai.
Maybe you are looking for
-
Is there any way to get a log of the bluetooth devices my Iphone has been connected to? I recenly had my Bluetooth Jabra stolen from my car and now a simliar one is on Craigslist. I'd like to give my connection log to the police before I go and see
-
Upgrading memory question - unbalanced / mixing memory
2006 Mac Pro. Here is what I have. 4-2 gig dimms and 2-512 dimms totalling 9 gigs of memory. What should be the order that I install the 512 dimms. Riser A: 2-2 gig dimms and the 2-512 dimms, then Riser B: 2-2 gig dimms or should all four 2 gig dimms
-
How to add on my itunes devive
help how do i put more device on my itunes
-
HOW TO IMPORT PRICE LIST?
Dear friends. i am facing problem in importing price list,can u plz help me. 1)i have made price list for certen items , that is ok with factor 1 2)now i wants to update this price list through DTW 3)but as per SAP templete i am anable to update it.
-
Deleted music from phone showing in iTunes?
I have it set to manage music manually. When I swipe delete music directly on the phone, the phone knows it's gone but it still shows up in iTunes. When clicked it just gives the exclamation mark in a circle icon. I have tried syncing, restarting,