Problem with saaj implementation
"Tubman, Olga" <[email protected]> Sun, 06 May 2007 08:19:47 +0000
| Newsgroups | gmane.text.xml.distributed |
|---|---|
| Message-ID | <1038E8469F565B4D99BE51B21F6B83B9030A8112@raaexc02.emea.cpqcorp.net> |
This is a multi-part message in MIME format.
------_=_NextPart_001_01C78FB7.4589731D
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
I have a question about using Axis2 saaj implementation.
I need to add Authorization and SoapAction to the message.
In the sun implementation I do it with adding headers to the
MimeHeaders:
=20
=20
byte[] authorization =3D Base64.encode(
"username:password".getBytes()); =20
MimeHeaders hd =3D message.getMimeHeaders();
hd.addHeader("Authorization", "Basic " + new
String(authorization));
hd.addHeader("SOAPAction", "RetrieveKeysList");
=20
However, in the Axis2 implementation this code is not working and I get
org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized' exception.
Moreover, I checked the source code and saw that nobody access to the
MimeHeaders in the message.
=20
Can you please help me and tell me how I can do it in Axis2?
=20
Thank you,
Olga.
=20
------_=_NextPart_001_01C78FB7.4589731D
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I have a question about using Axis2 saaj =
implementation.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I need to add Authorization and SoapAction to the =
message.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>In the sun implementation I do it with adding headers =
to the
MimeHeaders:</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
byte[] authorization =3D Base64.encode( =
"username:password".getBytes());
=
</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
MimeHeaders hd =3D message.getMimeHeaders();</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
hd.addHeader("Authorization", "Basic " + =
new
String(authorization));</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
hd.addHeader("SOAPAction", =
"RetrieveKeysList");</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>However, in the Axis2 implementation this code is not =
working
and I get org.apache.axis2.AxisFault: HTTP Transport error : '401' -
'Unauthorized' exception.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Moreover, I checked the source code and saw that =
nobody access
to the MimeHeaders in the message.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Can you please help me and tell me how I can do it in =
Axis2?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thank you,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Olga.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
</div>
</body>
</html>
------_=_NextPart_001_01C78FB7.4589731D--