Enable Call api to read the timeout from config file
----------------------------------------------------
Key: AXIS-2869
URL: https://issues.apache.org/jira/browse/AXIS-2869
Project: Axis
Issue Type: Improvement
Components: Basic Architecture
Affects Versions: 1.4
Environment: Applicable to all platforms
Reporter: bhaskarna
Fix For: 1.4
the default timeout is set to 60 seconds in the org/apache/axis/Constants.java
public static final int DEFAULT_MESSAGE_TIMEOUT=60*1000*10;
If we require to increase the timeout, the only option left is to invoke the
_call.timeout in the generated stub file. But we generate the stub files during
the build time so, we can't alter the stub files.
It is useful for the entire community if we make this configurable ... here is
the suggested fix in org/apache/axis/MessageContext.java:
public MessageContext(AxisEngine engine) {
this.axisEngine = engine;
if(null != engine){
java.util.Hashtable opts= engine.getOptions();
String attachmentsdir= null;
if(null!=opts) {
attachmentsdir= (String)
opts.get(AxisEngine.PROP_ATTACHMENT_DIR);
}
if(null == attachmentsdir) {
attachmentsdir= systemTempDir;
}
if(attachmentsdir != null){
setProperty(ATTACHMENTS_DIR, attachmentsdir);
}
// If SOAP 1.2 has been specified as the default for the engine,
// switch the constants over.
String defaultSOAPVersion = (String)engine.getOption(
AxisEngine.PROP_SOAP_VERSION);
if (defaultSOAPVersion != null && "1.2".equals(defaultSOAPVersion))
{
setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
}
String singleSOAPVersion = (String)engine.getOption(
AxisEngine.PROP_SOAP_ALLOWED_VERSION);
if (singleSOAPVersion != null) {
if ("1.2".equals(singleSOAPVersion)) {
setProperty(Constants.MC_SINGLE_SOAP_VERSION,
SOAPConstants.SOAP12_CONSTANTS);
} else if ("1.1".equals(singleSOAPVersion)) {
setProperty(Constants.MC_SINGLE_SOAP_VERSION,
SOAPConstants.SOAP11_CONSTANTS);
}
}
// Start suggested fix
try {
String timeout =
(String)engine.getTransport("http").getOptions().get("CONNECTION_TIMEOUT");
if(timeout != null) {
this.setTimeout(new Integer(timeout).intValue());
}
} catch(Exception e) {
e.printStackTrace(); //Please suggest the standard way to
handle this type exceptions...
}
}
// end suggested fix
}
And this is how the configuration file look:
<deployment
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<handler name="log" type="java:org.apache.axis.handlers.LogHandler"/>
<globalConfiguration>
<requestFlow>
<handler type="log"/>
</requestFlow>
<responseFlow>
<handler type="log"/>
</responseFlow>
</globalConfiguration>
<!--start suggested fix -->
<transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender">
<parameter name="CONNECTION_TIMEOUT" locked="false" value="4"/>
</transport>
<!--end suggested fix -->
</deployment>
I request owners to please review this suggested fix so that i can commit the
changes as suggested above.
Best Greetings,
Bhaskar
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]