blob: b6d540b673feff08969f73f7d35dce7c39f526fd [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia at 2015-07-03
| Rendered using Apache Maven Fluido Skin 1.3.0
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20150703" />
<meta http-equiv="Content-Language" content="en" />
<title>java.net HTTP Transport &#x2013; About</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.3.0.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido-1.3.0.min.js"></script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<div id="bannerLeft">
<h2>java.net HTTP Transport</h2>
</div>
</div>
<div class="pull-right"> <a href="../.." id="bannerRight">
<img src="../../images/axis-small.png" alt="Apache Axis"/>
</a>
</div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class="">
<a href="http://www.apache.org/" class="externalLink" title="Apache">
Apache</a>
</li>
<li class="divider ">/</li>
<li class="">
<a href="../../../../" title="Axis">
Axis</a>
</li>
<li class="divider ">/</li>
<li class="">
<a href="../../../" title="Axis 1.x">
Axis 1.x</a>
</li>
<li class="divider ">/</li>
<li class="">
<a href="../../" title="Java">
Java</a>
</li>
<li class="divider ">/</li>
<li class="">
<a href="./" title="java.net HTTP Transport">
java.net HTTP Transport</a>
</li>
<li class="divider ">/</li>
<li class="">About</li>
<li id="publishDate" class="pull-right">Last Published: 2015-07-03</li> <li class="divider pull-right">|</li>
<li id="projectVersion" class="pull-right">Version: 1.4.1-SNAPSHOT</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Project Documentation</li>
<li>
<a href="project-info.html" title="Project Information">
<i class="icon-chevron-down"></i>
Project Information</a>
<ul class="nav nav-list">
<li class="active">
<a href="#"><i class="none"></i>About</a>
</li>
<li>
<a href="project-summary.html" title="Project Summary">
<i class="none"></i>
Project Summary</a>
</li>
<li>
<a href="dependencies.html" title="Dependencies">
<i class="none"></i>
Dependencies</a>
</li>
</ul>
</li>
<li class="nav-header">Apache</li>
<li>
<a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="License">
<i class="none"></i>
License</a>
</li>
<li>
<a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsorship">
<i class="none"></i>
Sponsorship</a>
</li>
<li>
<a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks">
<i class="none"></i>
Thanks</a>
</li>
<li>
<a href="http://www.apache.org/security/" class="externalLink" title="Security">
<i class="none"></i>
Security</a>
</li>
</ul>
<form id="search-form" action="http://www.google.com/search" method="get" >
<input value="ws.apache.org/axis/java" name="sitesearch" type="hidden"/>
<input class="search-query" name="q" id="query" type="text" />
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=search-form"></script>
<hr class="divider" />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
</div>
</div>
</div>
<div id="bodyColumn" class="span9" >
<!-- Licensed to the Apache Software Foundation (ASF) under one --><!-- or more contributor license agreements. See the NOTICE file --><!-- distributed with this work for additional information --><!-- regarding copyright ownership. The ASF licenses this file --><!-- to you under the Apache License, Version 2.0 (the --><!-- "License"); you may not use this file except in compliance --><!-- with the License. You may obtain a copy of the License at --><!-- --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!-- --><!-- Unless required by applicable law or agreed to in writing, --><!-- software distributed under the License is distributed on an --><!-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --><!-- KIND, either express or implied. See the License for the --><!-- specific language governing permissions and limitations --><!-- under the License. --><p>By default Axis uses <tt>HTTPSender</tt> as the client-side HTTP transport. That implementation doesn't support keep-alive connections (i.e. connection pooling). Axis also ships a HTTP transport based on <a class="externalLink" href="http://hc.apache.org/httpclient-3.x/">Commons HttpClient</a>. This implementation supports connection pooling, but imposes additional requirements on application code, in particular that the service locator must be instantiated only once (for more information, see the <a class="externalLink" href="http://wiki.apache.org/ws/FrontPage/Axis/AxisCommonsHTTP">AxisCommonsHTTP how-to</a>). This means that it is not always possible to use it as a drop-in replacement for the default <tt>HTTPSender</tt> and that it may require changes to the application code.</p>
<p>To overcome this issue, Axis 1.4.1 introduces another client-side HTTP transport which is based on the <tt>java.net.HttpURLConnection</tt> API. This API built into the Java runtime supports keep-alive connections. Since there is a single connection pool managed by the JRE, all Axis stubs can take advantage of it, regardless of how service locators are instantiated. This means that this transport doesn't impose additional requirements on application code and can be used as a drop-in replacement of the default <tt>HTTPSender</tt>. However, it only works with Java 1.5 or higher because it relies on features of the <tt>java.net.HttpURLConnection</tt> API that were not available in earlier Java versions.</p>
<p>To use the java.net based HTTP transport, add <tt>axis-rt-transport-http-javanet-1.4.1-SNAPSHOT.jar</tt> to the class path. If you are using the default client configuration, it will be configured automatically. If you provide your own custom client configuration WSDD file, then configure the pivot handler for the <tt>http</tt> transport as shown in the following sample:</p>
<div>
<pre>&lt;deployment name=&quot;testClientConfig&quot;
xmlns=&quot;http://xml.apache.org/axis/wsdd/&quot;
xmlns:java=&quot;http://xml.apache.org/axis/wsdd/providers/java&quot;&gt;
&lt;globalConfiguration&gt;
&lt;parameter name=&quot;disablePrettyXML&quot; value=&quot;true&quot;/&gt;
&lt;parameter name=&quot;enableNamespacePrefixOptimization&quot; value=&quot;false&quot;/&gt;
&lt;/globalConfiguration&gt;
&lt;transport name=&quot;http&quot; pivot=&quot;java:org.apache.axis.transport.http.javanet.JavaNetHTTPSender&quot;/&gt;
&lt;/deployment&gt;</pre></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row span12">Copyright &copy; 2000-2015
<a href="http://www.apache.org/">The Apache Software Foundation</a>.
All Rights Reserved.
</div>
</div>
</footer>
</body>
</html>