|
|
|
|
Why can't eBay shopping service accept chunked Transfer-Encoding?
Posted:
Sep 15, 2007 2:40 PM
|
|
Hello,
I'm Glen Mazza, a volunteer on the Incubating Apache CXF web services project[1]. I recently created a blog entry[2] on how to access the eBay shopping API using both the GlassFish Metro and the Apache CXF web service stacks.
The eBay shopping API works fine with Metro but fails[3] with CXF, we get the following error message running with the CXF client:
<HTML><HEAD> <TITLE>411 Length Required</TITLE> </HEAD><BODY> Length Required A request of the requested method POST requires a valid Content-length. chunked Transfer-Encoding forbidden: shopping </BODY></HTML>
The reason for this problem is that while Metro sends a Content-Length, CXF sends the chunked transfer-encoding instead. According to the HTTP/1.1 standard[4], either one but not both must be set when you have a message payload.
But the eBay shopping API seems to be incorrectly requiring the Content-Length header, because if I understand the standard[4 again] correctly, 1.1-compliant servers are required to accept the chunked transfer-encoding type.
Is there a reason why eBay requires a Content-Length/will not allow chunked transfer encoding? Amazon ECS does not require it, and as a result both CXF and Metro work fine with it[5].
Thanks, Glen
[1] http://incubator.apache.org/cxf/ [2] http://www.jroller.com/gmazza/date/20070817 [3] http://issues.apache.org/jira/browse/CXF-945 [4] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 (under item #5) [5] http://www.jroller.com/gmazza/date/20070821
|
|
|
|
|
|
Re: Why can't eBay shopping service accept chunked Transfer-Encoding?
Posted:
Sep 28, 2007 6:00 PM
|
|
Hi gmazza123,
Nice articles.
You are correct that unfortunately; eBay Shopping API services do not support 'Transfer-Encoding: chunked' http message-header.
Best Regards, Zhuowei Yang eBay Developer Support
|
|
|