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 Ias <ia...@tmax.co.kr> on 2004/03/05 06:29:26 UTC

[SUMMARY] synchronization between request and response

Here's what I've done for implementing the synchronization.

The changes are

AxisServlet -> doPost
Message -> setup, writeTo, getContentType
SerializationContextImpl -> startElement
Call -> invoke(SOAPEnvelope), invoke()
SOAPPart -> getAsBytes, getAsSOAPEnvelope
SimpleAxisWorker -> execute
TestEncoding -> test
NonBlockingBufferedInputStream -> read and peek
SOAPConnectionImpl -> call

I'd like to mention about how it works based on WS-I Basic Profile 1.0 at
http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.htm . Please
see the following statement.

-----
4.1.11 Acceptable SOAP Character Encodings
The Profile requires all XML processors are required support the "UTF-8"
and "UTF-16" character encodings, in order to aid interoperability.

As a consequence of this, in conjunction with SOAP 1.1's requirement to use
the text/xml media type (which has a default character encoding of "us-
ascii"), the charset parameter must always be present on the SOAP
envelope's media type. A further consequence of this is that the encoding
pseudo-attribute of XML declaration within the message is always ignored,
in accordance with the requirements of both XML 1.0 and RFC3023, "XML Media
Types".

R1012 A MESSAGE MUST be serialized as either UTF-8 or UTF-16. 

R1018 The media type of a MESSAGE's envelope MUST indicate the correct
character encoding, using the charset parameter. C

When SOAP is used with the HTTP binding, the media type is carried in the
Content-Type HTTP header field. 
-----

Currently Axis uses UTF-8 as default. In this case, Axis sends a SOAP
request over HTTP like

...
Content-Type: text/xml; charset=UTF-8
...
<? xml encoding="UTF-8" ?>
...

and it responses like

...
Content-Type: text/xml; charset=UTF-8
...
<? xml encoding="UTF-8" ?>
...

If you specify UTF-16 as the character encoding of a request message
(TestEncoding.testSynchronization shows you how to do that), Axis requests 

...
Content-Type: text/xml; charset=UTF-16
...
<? xml encoding="UTF-16" ?>
...

and it responses

...
Content-Type: text/xml; charset=UTF-16
...
<? xml encoding="UTF-16" ?>
...

At last, I'm happy to tell you that this new feature passed "ant clean all-
tests". :-)

Ias

=========================================================
Lee, Changshin (Korean name)
Ias (International name)
               Company Web Site: http://www.tmax.co.kr
               Personal Web Site: http://www.iasandcb.pe.kr
---------------------------------------------------------
JSR 201, 204, 222 and 224 Expert Group Member
Apache Web Services Project Member
R&D Center
Tmax Soft, Inc.
=========================================================


RE: [SUMMARY] synchronization between request and response

Posted by Ias <ia...@tmax.co.kr>.
There's one more thing I'd like to mention. I tested this feature with
Tomcat 4.1.30 and found that it had a problem about decoding characters
through Xerces. I replaced the embedded Xerces 2.5 with the latest Xerces 2.
6.1 and concluded that it worked fine. It worked with Crimson equipped by
Sun's J2SE SDK 1.4.2_04 as well. I guess Xerces 2.5 has a bug handling
InputSource set by InputStream and encoding and Xerces 2.6 resolves it. I
hope the next Tomcat 4.1 release will endorse Xerces 2.6 or later. Probably
we need to make sure which version of Xerces Axis 1.2 recommends (or
requires).

Thanks,

Ias

=========================================================
Lee, Changshin (Korean name)
Ias (International name)
               Company Web Site: http://www.tmax.co.kr
               Personal Web Site: http://www.iasandcb.pe.kr
---------------------------------------------------------
JSR 201, 204, 222 and 224 Expert Group Member
Apache Web Services Project Member
R&D Center
Tmax Soft, Inc.
========================================================= 

> -----Original Message-----
> From: Ias [mailto:iasandcb@tmax.co.kr] 
> Sent: Friday, March 05, 2004 2:29 PM
> To: axis-dev@ws.apache.org
> Subject: [SUMMARY] synchronization between request and response
> 
> Here's what I've done for implementing the synchronization.
> 
> The changes are
> 
> AxisServlet -> doPost
> Message -> setup, writeTo, getContentType 
> SerializationContextImpl -> startElement Call -> 
> invoke(SOAPEnvelope), invoke() SOAPPart -> getAsBytes, 
> getAsSOAPEnvelope SimpleAxisWorker -> execute TestEncoding -> 
> test NonBlockingBufferedInputStream -> read and peek 
> SOAPConnectionImpl -> call
> 
> I'd like to mention about how it works based on WS-I Basic 
> Profile 1.0 at 
> http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.h
> tm . Please see the following statement.
> 
> -----
> 4.1.11 Acceptable SOAP Character Encodings The Profile 
> requires all XML processors are required support the "UTF-8"
> and "UTF-16" character encodings, in order to aid interoperability.
> 
> As a consequence of this, in conjunction with SOAP 1.1's 
> requirement to use the text/xml media type (which has a 
> default character encoding of "us- ascii"), the charset 
> parameter must always be present on the SOAP envelope's media 
> type. A further consequence of this is that the encoding 
> pseudo-attribute of XML declaration within the message is 
> always ignored, in accordance with the requirements of both 
> XML 1.0 and RFC3023, "XML Media Types".
> 
> R1012 A MESSAGE MUST be serialized as either UTF-8 or UTF-16. 
> 
> R1018 The media type of a MESSAGE's envelope MUST indicate 
> the correct character encoding, using the charset parameter. C
> 
> When SOAP is used with the HTTP binding, the media type is 
> carried in the Content-Type HTTP header field. 
> -----
> 
> Currently Axis uses UTF-8 as default. In this case, Axis 
> sends a SOAP request over HTTP like
> 
> ...
> Content-Type: text/xml; charset=UTF-8
> ...
> <? xml encoding="UTF-8" ?>
> ...
> 
> and it responses like
> 
> ...
> Content-Type: text/xml; charset=UTF-8
> ...
> <? xml encoding="UTF-8" ?>
> ...
> 
> If you specify UTF-16 as the character encoding of a request 
> message (TestEncoding.testSynchronization shows you how to do 
> that), Axis requests 
> 
> ...
> Content-Type: text/xml; charset=UTF-16
> ...
> <? xml encoding="UTF-16" ?>
> ...
> 
> and it responses
> 
> ...
> Content-Type: text/xml; charset=UTF-16
> ...
> <? xml encoding="UTF-16" ?>
> ...
> 
> At last, I'm happy to tell you that this new feature passed 
> "ant clean all- tests". :-)
> 
> Ias
> 
> =========================================================
> Lee, Changshin (Korean name)
> Ias (International name)
>                Company Web Site: http://www.tmax.co.kr
>                Personal Web Site: http://www.iasandcb.pe.kr
> ---------------------------------------------------------
> JSR 201, 204, 222 and 224 Expert Group Member Apache Web 
> Services Project Member R&D Center Tmax Soft, Inc.
> =========================================================
>