HTTP/1.1 and Chunked transfers
HTTP/1.1 and Chunked transfers
- Subject: HTTP/1.1 and Chunked transfers
- From: Lachlan Deck <email@hidden>
- Date: Fri, 6 Jul 2007 08:51:56 +1000
Hi there,
does anyone have any experience with receiving chunked data (or
perhaps sending chunked requests specifying the content-length with
Axis)?
I getting a 411 Length Required response in the client... so I'm
trying to ascertain whether there's some commons-httpclient setting
to have that generated when creating the requests (on the client
side) or if something else's afoot.
Any ideas?
i.e., in the client application there's something like this:
public MainServiceSoapBindingStub mainStub() {
if ( _stub == null ) {
MainService_ServiceLocator serviceLocator;
serviceLocator = new MainService_ServiceLocator();
this._stub = (MainServiceSoapBindingStub)
serviceLocator.getMainService();
<...>
if ( < enable compression condition > ) {
Map httpSettings;
// Set property to compress requests
this._stub._setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.TRUE);
// Tell the server it can compress responses
this._stub._setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
// enable chunking and http 1.1
httpSettings = new Hashtable();
httpSettings.put(MessageContext.HTTP_TRANSPORT_VERSION,
HTTPConstants.HEADER_PROTOCOL_V11);
httpSettings.put(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED,
Boolean.TRUE);
this._stub._setProperty(HTTPConstants.REQUEST_HEADERS, httpSettings);
}
}
}
And the stack trace below when calling one of the webservice methods.
with regards,
--
Lachlan Deck
[java] AxisFault
[java] faultCode: {http://xml.apache.org/axis/}HTTP
[java] faultSubcode:
[java] faultString: (411)Length Required
[java] faultActor:
[java] faultNode:
[java] faultDetail:
[java] {}:return code: 411
[java] <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//
EN">
[java] <HTML><HEAD>
[java] <TITLE>411 Length Required</TITLE>
[java] </HEAD><BODY>
[java] <H1>Length Required</H1>
[java] A request of the requested method POST requires a valid
Content-length.<P>
[java] chunked Transfer-Encoding forbidden: /cgi-bin/WebObjects/
WillowServices.woa/-55443/ws/MainService<P>
[java] <HR>
[java] <ADDRESS>Apache/1.3.33 Server at lds-mac.local
Port 80</ADDRESS>
[java] </BODY></HTML>
[java]
[java] {http://xml.apache.org/axis/}HttpErrorCode:411
[java]
[java] (411)Length Required
[java] at
org.apache.axis.transport.http.CommonsHTTPSender.invoke
(CommonsHTTPSender.java:218)
[java] at
org.apache.axis.strategies.InvocationStrategy.visit
(InvocationStrategy.java:32)
[java] at org.apache.axis.SimpleChain.doVisiting
(SimpleChain.java:118)
[java] at org.apache.axis.SimpleChain.invoke
(SimpleChain.java:83)
[java] at org.apache.axis.client.AxisClient.invoke
(AxisClient.java:165)
[java] at org.apache.axis.client.Call.invokeEngine
(Call.java:2784)
[java] at org.apache.axis.client.Call.invoke(Call.java:2767)
[java] at org.apache.axis.client.Call.invoke(Call.java:2443)
[java] at org.apache.axis.client.Call.invoke(Call.java:2366)
[java] at org.apache.axis.client.Call.invoke(Call.java:1812)
[java] at
my.client.app.ws.stubs.MainServiceSoapBindingStub.blahBlah
(MainServiceSoapBindingStub.java:874)
[java] <..>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden