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 sa...@apache.org on 2006/05/15 08:14:54 UTC

svn commit: r406549 - /webservices/axis2/trunk/java/xdocs/latest/http-transport.html

Author: saminda
Date: Sun May 14 23:14:53 2006
New Revision: 406549

URL: http://svn.apache.org/viewcvs?rev=406549&view=rev
Log:
updated for basic authentication 

Modified:
    webservices/axis2/trunk/java/xdocs/latest/http-transport.html

Modified: webservices/axis2/trunk/java/xdocs/latest/http-transport.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/xdocs/latest/http-transport.html?rev=406549&r1=406548&r2=406549&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/http-transport.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/http-transport.html Sun May 14 23:14:53 2006
@@ -26,6 +26,7 @@
   <li><a href="#timeout_config">Timeout Configuration</a></li>
   <li><a href="#version_config">HTTP Version Configuration</a></li>
   <li><a href="#auth">Proxy and NTLM Authentication</a></li>
+  <li><a href="#preemptive_auth">Basic Authentication</a></li>
 </ul>
 <a name="CommonsHTTPTransportSender"></a>
 
@@ -169,5 +170,28 @@
     used with HTTP 1.0 connections or servers that do not support HTTP
     keep-alives.</li>
 </ol>
+<a name="preemptive_auth"></a>
+<h2>Basic Authentication</h2>
+<p>Axis2 uses httpclient's preemptive authentication scheme for Basic Authentication
+ In this mode HttpClient will send the basic authentication response even before the 
+ server gives an unauthorized response in certain situations, thus reducing the overhead 
+ of making the connection. Following code snippet shows how to configure Axis2 handle basic 
+ authentication using credentials such as username and password. In addition to this user can 
+ include other credentials as well. Please refert to the API for more information. </p>
+ 
+ <pre>
+ ...
+ Options options = new Options();
+ 
+ HttpTransportProperties.BasicAuthentication
+                       basicAuthentication = new HttpTransportProperties().new
+                                                          BasicAuthentication();
+            basicAuthentication.setUsername("username");
+            basicAuthentication.setPassword("password");
+
+ options.setProperty(org.apache.axis2.transport.http.HTTPConstants.BASIC_AUTHENTICATION,basicAuthentication);
+ ...
+ </pre>
+
 </body>
 </html>