WebLogic returns funny characters in XML

Hi,
I have an application developed on Tomcat that includes a servlet that receives and XML post, processes the XML, then constructs an XML response packet (using JDOM) and flushes the response packet back to the calling process. This worked great under Tomcat, however now that I have ported it to WebLogic 6.1sp3, WebLogic appears to be adding some funny characters at the beginning and end of the XML response packet. Here's what it looks like.
00ae
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE scansresponse SYSTEM "scansresponse.dtd">
<scansresponse>
<transferresult>failure</transferresult>
</scansresponse>
0000
Any ideas on what might be causing this and how I can correct this problem? I've tried many different things and am stumped.
Thanks,
Chris

Your funny characters are from http "chunking". See the following link for more info: http://ken.coar.org/slides/HTTP/Chunking.html .
Each chunk is a hex number that indicates how big the chunk is. This can be a good thing! Processing the xml in chunks is faster than looping through it line by line.

Similar Messages

  • WL6.1 returns funny characters in XML

              Hi,
              I have an application I've ported from Tomcat to WebLogic 6.1sp3 and everything
              works great except for one thing.
              I have a servlet that posts an XML packet to another servlet that returns an XML
              response packet. The packet being returned always includes some odd characters
              at the beginning and end of the packet (see attached file).
              bad xml packet returned by weblogic
              00a6
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE scansresponse SYSTEM "scansresponse.dtd">
              <<scansresponse><transferresult>success</transferresult></scansresponse>
              0000
              There was no problem at all when running these servlets on Tomcat.
              I'd appreciate any suggestions.
              Thanks,
              Chris
              [badxml.txt]
              

              You have HTTP response encoded in chunked type. 00A6 means there are 166 bytes
              data in that chunk. 0000 means end of the response body. You have exactly 166
              bytes XML data including newlines.
              "Chris Lomvardias" <[email protected]> wrote:
              >
              >
              >
              >Hi,
              >
              >I have an application I've ported from Tomcat to WebLogic 6.1sp3 and
              >everything
              >works great except for one thing.
              >
              >I have a servlet that posts an XML packet to another servlet that returns
              >an XML
              >response packet. The packet being returned always includes some odd characters
              >at the beginning and end of the packet (see attached file).
              >
              >bad xml packet returned by weblogic
              >
              >00a6
              ><?xml version="1.0" encoding="UTF-8"?>
              ><!DOCTYPE scansresponse SYSTEM "scansresponse.dtd">
              ><<scansresponse><transferresult>success</transferresult></scansresponse>
              >0000
              >
              >
              >There was no problem at all when running these servlets on Tomcat.
              >
              >I'd appreciate any suggestions.
              >
              >Thanks,
              >
              >Chris
              

  • UTF-8 encoding Funny characters in DB

    Dear All,
    I am Facing a Critical issue which has been lagging, dragging
    from 3 days, still couldn't figure out an issue
    I've an XML file which am Getting it from a Server using
    <cffile action="READ" file="#application.settings.paths"
    variable="xml" charset="utf-8">
    and using an XMLPARSE to parse that xml and trying to insert
    that xml data into Database, in XML i've these
    characters master
    ’s, which should be like a single quote
    encoded like this but when saving to Database
    using a coldfusion query, Data is saving as some Funny
    Characters (i.e., master
    ?s),
    xml encoding is in UTF-8 and i don't know how to convert that
    zunk characters to normal characters like ( master's) - single
    quote)
    here are the things i tried.
    in Coldfusion Administrator i added a Connection String
    "useUnicode=true&characterEncoding=UTF-8"
    and checked the box which says "
    enable unicode for datasources configured for non-latin
    characters"
    Used a ConvertCharset Function passing xml object .. [/li]
    ii)
    <cfscript>
    function convertCharset(str,charsetFrom,charsetTo)
    var resultStr="";
    var javaString="";
    var byteArray="";
    javaString = CreateObject("java", "java.lang.String");
    javaString.init(str);
    byteArray = javaString.getBytes(charsetFrom);
    resultStr = CreateObject("java", "java.lang.String");
    resultStr.init(byteArray,charsetTo);
    return resultStr.toString();
    </cfscript>
    <cfcontent type="text/html; charset=UTF-8">
    <cfset setEncoding("URL", "UTF-8")>
    <cfset setEncoding("Form", "UTF-8")>
    tried this method also
    http://www.bennadel.com/blog/1206-Content-Is-Not-Allowed-In-Prolog-ColdFusion-XML-And-The- Byte-Order-Mark-BOM-.htm[/b
    Please let me know if i need to do anything.. other than the
    above methods,
    Thanks

    I am using SQL SERVER 2005 Database,
    Field is "Description" Varchar(2000)
    did you perform your test using the same table, code, etc.?
    Yes
    did you read in & dump out the xml file? Yes, I dumped
    the xml file and if i open in NOTEPAD in UTF-8 (filetype) then i
    see a single quote instead of that different character.
    is it really utf-8?
    so i think it's utf-8,
    if your mojibake. chars are from an ms word document, then
    they're not utf-8 but a superset of
    latin-1.
    they are not from MS WORD, i got an XML file which has all
    the course and presentation information..structured properly except
    those characters.. like
    ("younus has a Bachelor’s degree). i see
    that in UTF-8
    so i want to know to which format do i need to convert to when
    saving in Database (SQL SERVER 2005)
    Thanks.

  • How to remove special characters in xml

    Dear friends,
    How to remove the special character  from the xml. I am placing the xml file and  fetching through file adapter.
    The problem is when there is any special character in xml. i am not able to pass to target system smoothly.
    Customer asking schedule the file adapter in order to do that the source xml should not have any special charatcters
    How to acheive this friends,
    Thanx in advance.
    Take care

    Hi Karthik,
    Go throgh the following links how to handle special character
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Restricting special characters in XML within XI..
    Regards
    Goli Sridhar

  • Iweb pages hosted on a web server do not look right. Funny characters appea

    any web experts here?
    I have designed a bunch of pages in iWeb. Published them and uploaded them to my web host. However when I view the files via the web, they are not correct. The most obvious is that quote marks, bullets and paragraph markers are shown with funny characters.
    Take a look at www.dancingacademy.co.uk to see an example. Excuse the URL but its the only way I know of showing an example of what's wrong.
    If I view the files locally on my mac (ie publish from iweb to a folder and open them from the local folder) then the files look fine.
    It's only when they get sent from a webserver they look funny.
    Any ideas what my web hosting company is doing wrong?

    The server you are using is (mis)configured to force all browsers to use the wrong encoding. See this note (Server Settings section) for possible fixes:
    http://homepage.mac.com/thgewecke/iwebchars.html

  • ? is shown for Norwegian characters when XML document is parsed using DOM

    Hi,
    I've a sample program that creates a XML document with a single element book having Norwegian characters. Encoding is UTF-8. When i parse the XML document and try to access the value of that element then ? are shown for Norwegian characters. XML document file name is "Sample.xml"
                DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
                Document doc = docBuilder.newDocument();
                Element root = doc.createElement("root");
                root.setAttribute("value", "Á á &#260; &#261; ä É é &#280;");
                doc.appendChild(root);
                TransformerFactory transfac = TransformerFactory.newInstance();
                Transformer trans = transfac.newTransformer();
                trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
                trans.setOutputProperty(OutputKeys.INDENT, "yes");
                trans.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                //create string from xml tree
                java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
                StreamResult result = new StreamResult(baos);
                DOMSource source = new DOMSource(doc);
                trans.transform(source, result);
                writeToFile("Sample.xml", baos.toByteArray());
                InputSource is = new InputSource(new java.io.ByteArrayInputStream(readFile("Sample.xml")));
                is.setEncoding("UTF-8");
                DocumentBuilder obj_db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document obj_doc = obj_db.parse(is);
                obj_doc.normalize();
                System.out.println("Value is : " + new String(((Element) obj_doc.getElementsByTagName("root").item(0)).getAttribute("value").getBytes()));writeFile() - Writes the document bytes in Sample.xml file
    readFile() - Reads the Sample.xml file
    When i run this program XML editor shows the characters correctly but Java code output is: Á á ? ? ä É é ?
    What's the problematic area in my java code. I didn't get any help from any source. Please suggest me the solution of this problem.
    Thanx in advance.

    Hi,
    I'm using JBuilder 2005 and i mentioned encoding UTF-8 for saving Java source files and also for compilation. I've modified my source code also. But the problem persists. After applying changing the dumped sample.xml file doesn't display these characters correctly in IE, but earlier it was displaying it correctly at IE.
    Modified code is:
    DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
                Document doc = docBuilder.newDocument();
                Element root = doc.createElement("root");
                root.setAttribute("value", "Á á &#260; &#261; ä É é &#280;");
                doc.appendChild(root);
                OutputFormat output = new OutputFormat(doc, "UTF-8", true);
                java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
                OutputStreamWriter osw = new OutputStreamWriter(baos, "UTF-8");
                XMLSerializer s = new XMLSerializer(osw, output);
                s.asDOMSerializer();
                s.serialize(doc);
                writeToFile("Sample5.xml", baos.toByteArray());
                InputSource o = new InputSource(new java.io.ByteArrayInputStream(readFile("Sample5.xml")));
                o.setEncoding("UTF-8");
                com.sun.org.apache.xerces.internal.parsers.DOMParser obj_parser = new com.sun.org.apache.xerces.internal.parsers.DOMParser();
                obj_parser.parse(o);
                Document obj_doc = obj_parser.getDocument();
                System.out.println("Value : " + new String(((Element) obj_doc.getElementsByTagName("root").item(0)).getAttribute("value").getBytes()));I'm hanged on this issue. Can u please provide me the code snippet that works with these characters or suggest solution.
    Thanx

  • How to: SELECT statement returns the result in XML format.

    That's it... I want to execute a query that returns all rowset in XML format. How can I do it?
    Using Oracle 8.0 and up.
    Tnx.

    FOR XML is a proprietary Microsoft Hack... It is not supported by Oracle in any release. Oracle 9.2.x includes the SQLXML operators, which are part of the SQL:2003 standard and are the agreed upon (Mircosoft, IBM, Oracle etc) way of generating XML from relational data....
    See http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#sthref251

  • Carriage Returns & Line Feeds in XML documents

    Does anyone know why the PL/SQL XML parser will NOT work with Carriage Returns (0x0D) within the XML document?
    Currently I'm having to strip them out, leaving just the Line Feed (0x0A).
    I only realised this after looking at the family.xml example document.
    T.I.A.
    Geoff

    I forgot to mention that I'm running Oracle 8i on Windows NT.

  • Query regarding Handling Unicode characters in XML

    All,
    My application reads a flat file in series of bytes, I
    create a XMl document out of the data. The data contains Unicode characters.
    I use a XSLT to create XML file. While creating it I don't face any issues
    but later if I try to parse the constructed XMl file, i get a sax parsing exception
    (Caused by: org.xml.sax.SAXParseException: Character reference _"<not visible clearly in Browser>"_ is an invalid XML character.)
    Can some one advice on how to tackle this.
    regards,
    D
    Edited by: user9165249 on 07-Jan-2011 08:10

    How to tackle it? Don't allow your transformation to produce characters which are invalid in XML. The XML Recommendation specifies what characters are allowed and what characters aren't, in section 2.2: http://www.w3.org/TR/REC-xml/#charsets. The invalid characters can't come from the XML which you are transforming so they must be coming from code in your transformation.
    And if you can't tell what the invalid characters are by using your browser, then send the result of the transformation to a file and use a hex editor to examine it.
    By the way, this isn't a question about Unicode characters in XML, since all characters in Java are Unicode and XML is defined in terms of Unicode. So saying that your data contains Unicode characters is a tautology. It couldn't do anything else. If your personal definition of Unicode is "weird stuff that I don't understand" then do yourself a favour, take a couple of days out and learn what Unicode is.

  • XMLTABLE function not returning any values if xml has attribute "xmlns"

    Hi,
    XMLTABLE function not returning any values if xml has attribute "xmlns". Is there way to get the values if xml has attribute as "xmlns".
    create table xmltest (id number(2), xml xmltype);
    insert into xmltest values(1,
    '<?xml version="1.0"?>
    <emps>
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    insert into xmltest values(2,
    '<?xml version="1.0"?>
    <emps xmlns="http://emp.com">
    <emp empno="1" deptno="10" ename="John" salary="21000"/>
    <emp empno="2" deptno="10" ename="Jack" salary="310000"/>
    <emp empno="3" deptno="20" ename="Jill" salary="100001"/>
    </emps>');
    commit;
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    The above query returning results but below query is not returning any results because of xmlns attribute.
    SELECT a.*
    FROM xmltest,
    XMLTABLE (
    'for $i in /emps/emp
    return $i'
    PASSING xml
    COLUMNS empno NUMBER (2) PATH '@empno',
    deptno NUMBER (3) PATH '@deptno',
    ename VARCHAR2 (10) PATH '@ename',
    salary NUMBER (10) PATH '@salary') a
    WHERE id = 1;
    how to get rid out of this problem.
    Thanks,
    -Mani

    Added below one in xmltable, its working now.
    XmlNamespaces(DEFAULT 'http://emp.com')

  • How a SELECT statement can return the results in XML format

    That's it... I want to execute a query that returns all rowset in XML format. How can I do it?
    I have Oracle 9i
    Thanks
    Jaime

    9i, or 9iR2 ?. If 9i I would recommend upgrading to 9iR2 and then using the SQL/XML operators.

  • Why oracle function return 4000 characters ?

    Dear All
    When I write any function to get some return value in a query, its width is set to 4000. Moreover, when i write the same query to create any LOV, it gives an error that record group field cannot be greater than 2000. Where the actual width of this field is 200 characters.
    Why function always returns 4000 characters?
    Regards
    Edited by: OraLearner on Dec 1, 2010 11:47 AM

    Because the maximum of a varchar2 in SQL is 4000 and you have no dimension in your function:
    SQL> r
      1  create or replace function myfunc(inMaxVal in number) return varchar2 is
      2    vRet varchar2(32000);
      3  begin
      4    for i in 1..inMaxVal loop
      5      vRet := vRet || '1';
      6    end loop;
      7    return vRet;
      8* end;
    Function created.
    SQL> select myfunc(4001) from dual;
    select myfunc(4001) from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SCOTT.MYFUNC", line 7
    SQL> select myfunc(4000) from dual;
    MYFUNC(4000)
    1111111111111111111111111111111111111111111111111111
    1111111111111111111111111111111111111111111111111111so the SQL Engine have to assume your function returns 4000 bytes. If you use this function in PL/SQL it can be up to 32767 bytes:
    SQL> r
      1  begin
      2  dbms_output.put_line(substr(myfunc(4002), 1,255));
      3* end;
    11111111111111111111111111111111111111111111111111111111
    PL/SQL procedure successfully completed.cheers

  • Eastern European characters in XML and parsing

    Hi all,
    I have a problem with XML parsing within Java code with special Eastern European characters.
    Whenever there is EE character within tags it reports:
    WARNING (12847): CORE3283: stderr: org.xml.sax.SAXParseException: The element type "CodeMeaning" must be terminated by the matching end-tag "</CodeMeaning>".
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:134)
    Obviously special character is in CodeMeaning XML tag. XML is well formed and syntactically OK and without special characters works OK. Does anyone have any suggestion how to force special characters in XML?

    Would you send a sample data for test? What is the encoding for your XML doc?

  • Special characters in XML barcode content

    Hello,
    I made a barcoded form with a custom script that creates a custom XML as barcode content.
    The decoding happens well when the user write plain text in the text fields, but whenever it inputs some special characters (for XML syntax), like ",<,>,=,etc... the content of barcode it is decoded as:
    <barcode>
    <!CDATA[... true content ...]>
    </barcode>
    how can I handle this situation?
    I have to handle what the user writes or I have to change the decode activity?
    Thank you very much for your support!
    Fabio

    Steve,
    I have already encoded decode operation in UTF-8. In form level, because it is an acrobat form, no option to choose the encoding as in LC Designer. In further tests, if I change the extractToXML output to XDP instead of XFDF, then I will receive data rather than &# sequence. It is strange. Don't understand why XDP and XFDF would give out different encoding.
    Tim

  • Funny characters within my text when uploaded

    Hello, I have published my website to a folder and uploaded through Fetch. I used only Arial font in my design. When I view the website in any browser - so far i've tried safari and internet explorer, I have "funny characters" within my text. It seems to mostly occur after, or in place of, a punctuation mark. The characters look like white question marks in a dark diamond.
    I'm fairly new to iWeb. Any advice would be greatly appreciated!
    Cheers!
    Lilly
    Message was edited by: TXlillypad

    hmmm, I just tried changing the preferences in fetch.
    Please read the link you were given again. The very first lines tell what to do depending on what kind of character you are seeing. The Fetch thing is when you see question marks. Is that your case? If not, do the other one.
    do you think it could be the server I'm uploading to?
    If you are seeing something other than question marks, yes, as the link says.
    http://homepage.mac.com/thgewecke/iwebchars.html

Maybe you are looking for

  • Sales with third-party manufacturer

    Hi gurus, I need your help with the following sales scenario: My company produces product A. Product B can be manufactured applying minor changes in product A. However, my company doesn't have the machinery to do these changes. They need to be done b

  • Report to measure CRM Activities performance

    Hi experts, I'm on SAP CRM 6.0 and currently doing some research about available reports on Web UI. I'm particularly interested in reports that will allow to measure activity performance like: how long has an activity been opened? how long since the

  • Information about OOD

    Hi all. This isnt really a java question I have but I am interested in the basics of OOD. Mainly the analysis and design aspects. Now I was wondering if you have any basic sites where I can get information to help me? I was mainly curious about how d

  • Email PO Attachment to Vendor

    Hi, When I send the PO to vendor via email (5-External Send), the PO attachment (DOC, XLS or JPG) doesn't get transmitted alongwith the PO. Am I missing something or is it not possible? I am on ECC 6.0 Cheers!!! Amit

  • Purchase code number doesnt seem to work, it says invalid

    purchase code number doesnt seem to work, it says invalid