You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/04/08 09:59:25 UTC

DO NOT REPLY [Bug 18802] New: - Codepage problem with GET requests on z/OS

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18802>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18802

Codepage problem with GET requests on z/OS

           Summary: Codepage problem with GET requests on z/OS
           Product: Axis
           Version: 1.1rc2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: erj@bankdata.dk


I have installed Axis on WebSphere Application Server ver 3.5, running on z/os, 
USS. On this platform, the default codepage is EBCDIC Cp1142 (EBCDIC Denmark 
and Norway, Euro support).

When i test my services with GET requests (for 
instance: .../axis/services/Bankoplysninger?method=getBank&banknr=7), i get 
this error:
<soapenv:Fault>
   <faultcode>soapenv:Server.userException</faultcode>
   <faultstring>org.xml.sax.SAXParseException: Content is not allowed in 
prolog.</faultstring>
   <detail/>
  </soapenv:Fault>

I think that the problem is due to the fact, that when you read a 
ByteArrayInputStream, without specifying what code page to use, yuo use the 
default (in my case the Cp1142), and the HTTPrequest is sent as normal ASCII 
ISO-8859-1. That happens when the AxisServlet reads the request, and constructs 
a proper POST request.

I have corrected the problem in AxisServlet, method invokeEndpointFromGet this 
way:

ORIGINAL:

ByteArrayInputStream istream = new ByteArrayInputStream(msgtxt.getBytes());

MY CORRECTION:

ByteArrayInputStream istream;
  try {istream = new ByteArrayInputStream(msgtxt.getBytes("ISO-8859-1"));
	} catch (UnsupportedEncodingException e) {
		// TODO Is this correct exceptionhandling?
		istream = new ByteArrayInputStream(msgtxt.getBytes());
		System.out.println("Error in Axisservlet: " + e);
	}

With this correction Axis runs fine on my z/OS as welle as on my local NT-based 
Tomcat.

Regards 

Erling J�rgensen