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.