I believe I have located a bug in the current Apache SOAP source that prevents the default encoding from being correctly applied.
The SOAPMappingRegistry class, a subclass of XMLJavaMappingRegistry, now support chaining, i.e. an instance has a parent, with the parent being null for the "root" instance. When looking up a mapping, the chain is followed if necessary to resolve the mapping. The XMLJavaMappingRegistry class has a method setDefaultEncodingStyle, which sets the default encoding style. When this method is called on a SOAPMappingRegistry instance, the default encoding style is set only for the particular link in the chain. It is *not* set for the parent (and recursively for all parents). This breaks the proper application of the default. The fix is to override the implementation in the SOAPMappingRegistry class to do this chaining: public void setDefaultEncodingStyle(String defEncStyle) { super.setDefaultEncodingStyle(defEncStyle); parent.setDefaultEncodingStyle(defEncStyle); } Scott ----- Original Message ----- From: "Scott Nichol" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 09, 2002 1:19 PM Subject: Re: please help us: interop problems with HP-SOAP > I've poked around the code with no definitive answer, but I am suspicious of > something. It appears all other servers are specifying > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" somewhere in > the response. I am wondering whether the ability of Apache SOAP to handle the > "default" encoding (no encoding specified in the message) has been broken. The > code has changed in that area, but I do not see anything broken as yet. > > Scott Nichol > > ----- Original Message ----- > From: "Scott Nichol" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, April 09, 2002 11:55 AM > Subject: Re: please help us: interop problems with HP-SOAP > > > > I am not Sam, but I ran the interop test from my box using both SOAP 2.2 and > > SOAP 2.2+, the latter being last night's build. From what passes over the > wire > > for the string test (as captured by TcpTunnelGui, see below), things look fine > > to me. The only difference in the response is the use of the 2001 xsi/xsd > > namespaces, rather than 1999. I'm taking a look at the source now. > > > > Scott Nichol > > > > Sent by SOAP 2.2: > > > > POST /hpws/soap/EchoService HTTP/1.0 > > Host: localhost > > Content-Type: text/xml; charset=utf-8 > > Content-Length: 476 > > SOAPAction: "http://soapinterop.org/echoString" > > > > <?xml version='1.0' encoding='UTF-8'?> > > <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/1999/XMLSchema"> > > <SOAP-ENV:Body> > > <ns1:echoString xmlns:ns1="http://soapinterop.org/" > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > > <inputString xsi:type="xsd:string">Hi there!</inputString> > > </ns1:echoString> > > </SOAP-ENV:Body> > > </SOAP-ENV:Envelope> > > > > Received by SOAP 2.2: > > > > HTTP/1.0 200 OK > > Server: HP-IS Http Listener/1.0 > > Date: Tue, 09 Apr 2002 15:46:16 GMT > > Content-Type: text/xml > > > > <?xml version="1.0" encoding="UTF-8"?> > > <SOAP-ENV:Envelope > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns1:e > > choStringResponse xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:ns1="http://soapinterop.org/" > xmlns:xsd="http://www.w3.org/1999/XMLSchema" > > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"><return > > xsi:type="xsd:string">Hi > > there!</return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> > > > > Sent by SOAP 2.2+: > > > > POST /hpws/soap/EchoService HTTP/1.0 > > Host: localhost > > Content-Type: text/xml; charset=utf-8 > > Content-Length: 476 > > SOAPAction: "http://soapinterop.org/" > > > > <?xml version='1.0' encoding='UTF-8'?> > > <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > > <SOAP-ENV:Body> > > <ns1:echoString xmlns:ns1="http://soapinterop.org/" > > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> > > <inputString xsi:type="xsd:string">Hi there!</inputString> > > </ns1:echoString> > > </SOAP-ENV:Body> > > </SOAP-ENV:Envelope> > > > > Received by SOAP 2.2+: > > > > HTTP/1.0 200 OK > > Server: HP-IS Http Listener/1.0 > > Date: Tue, 09 Apr 2002 15:47:24 GMT > > Content-Type: text/xml > > > > <?xml version="1.0" encoding="UTF-8"?> > > <SOAP-ENV:Envelope > > > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><ns1:e > > choStringResponse xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" > > xmlns:ns1="http://soapinterop.org/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><return > > xsi:type="xsd:string">Hi > > there!</return></ns1:echoStringResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> > > > > ----- Original Message ----- > > From: "CHEN,SHIH-CHANG (HP-NewJersey,ex2)" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, April 09, 2002 9:24 AM > > Subject: please help us: interop problems with HP-SOAP > > > > > > > Hi, > > > > > > I noticed that HP-SOAP fails all the interop > > > tests with Apache SOAP2.2+: > > > http://www.apache.org/~rubys/ApacheClientInterop.html > > > > > > We compare the wire messages, but still cannot > > > figure out what cause the problems that we pass > > > all axis tests but fail ApacheSOAP tests. > > > > > > We will appriciate it if you can provide us more > > > information about what cause the tests failed in > > > your test clients. > > > > > > Many thanks, > > > > > > Shih-Chang Chen > > > > > > _________________________________________________________ > > Do You Yahoo!? > > Get your free @yahoo.com address at http://mail.yahoo.com > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com