Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Content-Length not set in the Axis 1.4 http Response Header

 
vasu Sanaboina
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Content-Length is not set in the http response header. We are using AXIS 1.4 version. tomcat7. We need Content-Length to process the SOAP message. Kindly provide any configuration changes need to set in the response header.

Server : Tomcat7
Java : jre6
Protocol : HTTP/1.1
web service : AXIS 1.4

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is my impression that AXIS 1 has not been supported for years and has been supplanted by Axis 2.

You should probably move your project to AXIS 2.

Bill
 
vasu Sanaboina
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To set the content length in response header attribute we implemented handler and configured the same in server-config.wsdd.

<transport name="http">
<requestFlow>
<handler type="URLMapper"/>
<handler type="javarg.apache.axis.handlers.http.HTTPAuthHandler"/>
</requestFlow>

<responseFlow>
<handler type="java:com.lucent.tcoma.webservice.STARSAxisHandler"/>
</responseFlow>


<parameter name="qs:list" value="org.apache.axis.transport.http.QSListHandler"/>
<parameter name="qs:wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
<parameter name="qs.list" value="org.apache.axis.transport.http.QSListHandler"/>
<parameter name="qs.method" value="org.apache.axis.transport.http.QSMethodHandler"/>
<parameter name="qs:method" value="org.apache.axis.transport.http.QSMethodHandler"/>
<parameter name="qs.wsdl" value="org.apache.axis.transport.http.QSWSDLHandler"/>
</transport>

Handler Class implementation as follows

public void invoke(MessageContext context) throws AxisFault {
try {
Message msg = context.getResponseMessage();
HttpServletResponse res = (HttpServletResponse) context
.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE);
res.setContentLength(msg.getSOAPPartAsString().length());
logger.info("Setting Content-Length in Response Header-->"
+ msg.getSOAPPartAsString().length());
} catch (Exception e) {
logger.error("Setting Content-Length in Response Failed for STARS exposed services -->"
+ e.getMessage());
e.printStackTrace();
}
}

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic