Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Web Experience Factory wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Web Experience Factory 8 Documentation WebSphere Portlet Factory 7 Documentation WebSphere Portlet Factory 7.0.1 Documentation Custom Search Scope...
Search
Community Articles > FAQs > Configuring AXIS to use Commons HTTP Client and HTTP 1.1
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Mike Burati
Contribution Summary:
  • Articles authored: 10
  • Articles edited: 21
  • Comments Posted: 0

Recent articles by this author

How do I create a multi-page form?

The basic trick to making a multipage form is to have one variable that will contain all the data, then have several different pages, each with its own Data Page builder, all pointing at the same variable.  Then, add a Data Field Modifier to each page, hiding all the fields that you don't want on ...

Portlet Filter Sample

Overview


The Java Portlet Specification 2.0 added the concept of Portlet Filters, to allow for code to be called on portlet initialization, destruction and action, event and render phases, so that developers could intercept portlet requests and insert additional functionality to ...

Best Practices for Model Development

Brought to you by the WebSphere Portlet Factory Development Team
© Copyright International Business Machines Corporation 2006, 2009. All rights reserved.

This document is a collection of best practices, tips, and suggestions from the WebSphere Portlet Factory development team. It ...

Logging

WebSphere Portlet Factory uses the Apache Log4j logging services to log warnings, errors, exceptions, statistics and debugging information to a deployed WAR's WEB-INF/logs folder. These logs and the information they provide can give you a lot of clues and information to use when debugging and ...

Accessing inputs from a portlet

Question: How do I access form inputs from a portlet page?
New users often ask: How do I access form inputs from a portlet page? My code in the page works when I run it standalone, but not when run as a portlet.
First of all, you really shouldn't have to hand code any Java in pages ...

Community articleConfiguring AXIS to use Commons HTTP Client and HTTP 1.1

Added by Mike Burati | Edited by IBM contributor Rob Flynn on January 15, 2010 | Version 5
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: Web Services

Question: Can I configure WPF Web Services to use HTTP 1.1 instead of HTTP 1.0.


Answer: This question has come up a couple of times on the WPF forums over the last year or two, so I've written up this techniques article to describe how you might do this.


WebSphere Portlet Factory, and thus also Lotus Widget Factory, use the Apache AXIS 1.x web services framework to make web service calls. Prior to WPF 6.1 AXIS 1.2.2 was used, and as of WPF 6.1.x, AXIS 1.4 is used. For more about Apache AXIS, refer to http://ws.apache.org/axis


Apache AXIS version 1.x uses an HTTP sender implementation built directly on the java.net.* APIs by default, and those in turn make HTTP 1.0 requests by default. According to the wiki and faq documentation on the above AXIS web site, you must configure AXIS to use the optional Apache Commons HTTP (commons-http) client based HTTP sender implementation, in order to leverage the commons-httpclient HTTP 1.1 functionality.


Using AXIS with commons-http requires including the Apache Commons HTTP client jar either in your WAR's WEB-INF/lib or in the appserver (you may find it's already available in some appservers, possibly even including WAS/WP). Then you have to tell AXIS to use its CommonsHTTP sender instead of its default HTTP sender. To tell AXIS to do that, you need to specify a custom client-config.wsdd configuration to AXIS. By default, AXIS provides a client-config.wsdd configuration in axis.jar, but lets you override it. One of the options for overriding it includes placing that file in the classpath in org/apache/axis/client/client-config.wsdd and hope that it gets picked up before the one in axis.jar. Another way to force it would be to set an AXIS property explicitly telling AXIS to use your client-config.wsdd instead of the one supplied in the axis.jar (the ws.apache.org/axis website has doc on how to do that, along with some of the articles you'll find if you search on AXIS and client-config.wsdd ). Setting an AXIS-wide property may be a bigger hammer than you need if putting your own copy of client-config.wsdd in the classpath works.


Open up axis.jar with a tool like winzip and find the client-config.wsdd that comes with it and open it in a text editor to see what the default looks like. You'll see something like this:

<?xml version="1.0" encoding="UTF-8"?>
<deployment name="defaultClientConfig" xmlns=http://xml.apache.org/axis/wsdd/ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <globalConfiguration>
    <parameter name="disablePrettyXML" value="true"/>
    <parameter name="enableNamespacePrefixOptimization" value="false"/>
  </globalConfiguration>
  <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
  <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>
  <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>
</deployment>



The contents of a client-config.wsdd that tells AXIS to use Apache commons-http instead of the java.net based http sender would look something like this (note, the http transport pivot value has been changed):

<?xml version="1.0" encoding="UTF-8"?>
<deployment name="ApacheCommonsHTTPConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <globalConfiguration>
    <parameter name="disablePrettyXML" value="true"/>
    <parameter name="enableNamespacePrefixOptimization" value="false"/>
  </globalConfiguration>
  <transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" />
  <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender" />
  <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender" />
</deployment>


Once you have the above custom client-config.wsdd file configured correctly, then AXIS should use the Apache Commons HTTP sender.


Step 1: Put the above XML specifying use of the CommonsHTTPSender into your WPF project in a file called WEB-INF/classes/org/apache/axis/client/client-config.wsdd


Step 2: Put a copy of the 3.0 version of Apache Commons HTTP jar (available from jakarta.apache.org) in your project's WEB-INF/lib folder


(NOTE: it seems like portal has a copy but it may not be the same version or it may drag in incompatible versions of other Apache libraries from portal, as it caused class loading collision errors when I tried to use it directly, before adding the 3.0 version directly to my project).


Step 3: Redeploy the project as an application and/or portlet WAR file to your application server.


Step 4: Execute your portlet or web application that consumes the web service.



Using the above steps, when I ran the web service model in my project/WAR before making any changes, while watching the web service traffic with a TCP tunnel, I saw the following as the first line of the HTTP based SOAP request made by WPF's use of AXIS:

POST /mywebservice HTTP/1.0


After the above changes, I now see the following, when I make the same web service request, since AXIS is using the commons-httpclient jar which uses HTTP 1.1 by default.

POST /mywebservice HTTP/1.1



There is usually no need to do the above work and incur the extra overhead of yet another component and layer in your web service calls, but since the question was asked (in the context of AXIS can do this, can WPF's use of AXIS do that?), it's documented here so you don't have to go figure this all out yourself if you really need to use it. The above is a sample technique only, and is not how WPF's use of AXIS ships out of the box or was built and qualified in any current release, so if you do run into problems consuming web services after doing the above, please verify that you are seeing the same problems in an out of the box WPF configuration before contacting customer support about a problem that may be caused by the non-standard custom configuration described above or variation thereof.


According to the Apache AXIS and Jakarta Commons web sites and other sites with information about these components, there may be additional functionality supported by the Apache Commons HTTP framework (such as integration with certain 3rd party proprietary HTTP authentication mechanisms) that you may be able to use with the help of commons-httpclient, by leveraging a custom AXIS configuration like that described above. This custom integration is not part of the standard WPF qualified and supported configuration though, so your mileage may vary while trying to rely on custom integration of open source software to add functionality not provided in the base product. In case of issues with such custom configuration, try using a search engine to search for the above combined terminology to see if others with the same configuration have suggestions and answers to your questions, and then try the WPF web service forum if a search doesn't turn up the right answers.


  • Edit
  • More Actions Show Menu▼


expanded Attachments (1)
collapsed Attachments (1)
Edit the article to add or modify attachments.
File TypeSizeFile NameCreated On
application/x-zip 1 KB AxisConfig.zip 10/2/08 4:24 PM
expanded Versions (5)
collapsed Versions (5)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (5)Jan 15, 2010 5:26:07 PMRob Flynn  IBM contributor
4Dec 21, 2009 3:59:10 PMRob Flynn  IBM contributor
3Dec 21, 2009 3:58:14 PMRob Flynn  IBM contributor
2Dec 21, 2009 3:55:44 PMRob Flynn  IBM contributor
1Oct 2, 2008 4:24:24 PMMike Burati  IBM contributor
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • BlogsIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use