Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 83915 invoked from network); 23 Jul 2008 22:51:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jul 2008 22:51:53 -0000 Received: (qmail 34629 invoked by uid 500); 23 Jul 2008 22:51:44 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 34597 invoked by uid 500); 23 Jul 2008 22:51:44 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 34581 invoked by uid 99); 23 Jul 2008 22:51:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 15:51:44 -0700 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=HTML_MESSAGE,PLING_QUERY,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [15.201.24.19] (HELO g4t0016.houston.hp.com) (15.201.24.19) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 22:50:48 +0000 Received: from G1W0400.americas.hpqcorp.net (g1w0400.americas.hpqcorp.net [16.236.31.10]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by g4t0016.houston.hp.com (Postfix) with ESMTP id 7B7D914CBB for ; Wed, 23 Jul 2008 22:51:13 +0000 (UTC) Received: from G3W0628.americas.hpqcorp.net (16.233.58.53) by G1W0400.americas.hpqcorp.net (16.236.31.10) with Microsoft SMTP Server (TLS) id 8.1.263.0; Wed, 23 Jul 2008 22:50:09 +0000 Received: from GVW1096EXB.americas.hpqcorp.net ([16.234.97.241]) by G3W0628.americas.hpqcorp.net ([16.233.58.53]) with mapi; Wed, 23 Jul 2008 22:50:09 +0000 From: "Merritt, Norris" To: "axis-user@ws.apache.org" Date: Wed, 23 Jul 2008 22:50:07 +0000 Subject: Axis2: Still has problems with setting SOAPAction and Authorization headers via SAAJ api ?!? Thread-Topic: Axis2: Still has problems with setting SOAPAction and Authorization headers via SAAJ api ?!? Thread-Index: AcjtFnRYkmFtdEPmQHy9FvyEBzNvig== Message-ID: <2DFFFD3D068ACF4F986D21E82956DAB030BBA7F393@GVW1096EXB.americas.hpqcorp.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_2DFFFD3D068ACF4F986D21E82956DAB030BBA7F393GVW1096EXBame_" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Virus-Checked: Checked by ClamAV on apache.org --_000_2DFFFD3D068ACF4F986D21E82956DAB030BBA7F393GVW1096EXBame_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Why does a trivial SAAJ client which imports only javax.xml.soap.* work cor= rectly with Sun's JAX-WS 2.1 libraries in the classpath, but fail when I su= bstitute either the Axis2 1.3 or Axis2 1.4 libraries? The client app is co= nstructing the SOAPAction and Authorization mime headers itself, then using= SOAPConnection.call to send the message: SOAPEnvelope soapEnvelope =3D soapMessage.getSOAPPart().getEnvelope= (); SOAPBody body =3D soapEnvelope.getBody(); SOAPBodyElement operation =3D body.addBodyElement (soapEnvelope.createName( requestName, nsPrefix, nsURI )); // Basic Authorization header String authorization =3D new sun.misc.BASE64Encoder().encode((userI= d+":"+pwd).getBytes()); MimeHeaders hd =3D soapMessage.getMimeHeaders(); hd.addHeader( "Authorization", "Basic " + authorization); // SOAPAction header hd.addHeader( "SOAPAction", soapAction ); SOAPMessage response =3D null; try { response =3D conn.call( request, endpointURL ); } catch( Exception e ) { System.out.println( "Got exception " + e.toString() ); } With Sun JAX-WS 2.1, the application works fine. With Axis2 1.3, I get exception javax.xml.soap.SOAPException: org.apache.ax= is2.deployment.DeploymentException: org/apache/commons/httpclient/HttpExcep= tion With Axis2 1.4, I get exception javax.xml.soap.SOAPException: Transport err= or: 401 Error: Unauthorized Searching the Axis user archives reveals that Axis has had issues in this a= rea since Axis 1.0 rc1. I found bug 14636 for that release "SOAPAction Mim= eHeader set via SAAJ not passed on". I found another bug against Axis 1.2,= number 1545. This time Axis was generating TWO soapaction headers! Now Ax= is is back to generating zero headers. --_000_2DFFFD3D068ACF4F986D21E82956DAB030BBA7F393GVW1096EXBame_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Why does a trivial SAAJ client which imports only javax.= xml.soap.* work correctly with Sun’s JAX-WS 2.1 libraries in the classpath, but = fail when I substitute either the Axis2 1.3 or Axis2 1.4 libraries?  The cl= ient app is constructing the SOAPAction and Authorization mime headers itself, t= hen using SOAPConnection.call to send the message:

 

        SOAPEnvelope soapEnvelope =3D soapMessage.getSOAPPart().getEnvelope();=

        SOAPBody body= =3D soapEnvelope.getBody();

        SOAPBodyEleme= nt operation =3D body.addBodyElement

         &n= bsp;      (soapEnvelope.createName( requestName, nsPrefix, nsURI ));

 

        // Basic Authorization header

        String authorization =3D new sun.misc.BASE64Encoder().encode((userId+":"+pwd).getBytes());

        MimeHeaders h= d =3D soapMessage.getMimeHeaders();

        hd.addHeader( "Authorization", "Basic " + authorization);<= /span>

 

        // SOAPAction header

        hd.addHeader( "SOAPAction", soapAction );

 

        SOAPMessage response =3D null;

 

        try

        {<= /span>

          &= nbsp;response =3D conn.call( request, endpointURL );

        }<= /span>

        catch( Except= ion e )

        {<= /span>

          &= nbsp;System.out.println( "Got exception " + e.toString() );

        }<= /span>

 

With Sun JAX-WS 2.1, the application works fine.

 

With Axis2 1.3, I get exception javax.xml.soap.SOAPException: org.apache.axis2.deployment.DeploymentExcepti= on: org/apache/commons/httpclient/HttpException

With Axis2 1.4, I get exception javax.xml.soap.SOAPExcep= tion: Transport error: 401 Error: Unauthorized

 

Searching the Axis user archives reveals that Axis has h= ad issues in this area since Axis 1.0 rc1.  I found bug 14636 for that release “SOAPAction MimeHeader set via SAAJ not passed on”. &nb= sp;I found another bug against Axis 1.2, number 1545. This time Axis was generat= ing TWO soapaction headers!  Now Axis is back to generating zero headers.<= o:p>

--_000_2DFFFD3D068ACF4F986D21E82956DAB030BBA7F393GVW1096EXBame_--