axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Blecken" <cblec...@macrovision.com>
Subject RE: issues establishing a persistent connection
Date Thu, 21 Apr 2005 20:54:42 GMT
Hi Joe,

yes the connection teardown at every call can be an issue.

I played some time ago in the stub layer to expose the Call
initialization/deinit which keeps the connection :

The Stub object AxisService.cpp is build structurally as :

AxisService::AxisService() {}
 
AxisService::~AxisService() {}

AxisService::setValue(int val) {
	m_pCall->initialize(CPP_DOC_PROVIDER);     // open the connection
      ...    // serializing
	m_pCall->invoke();
      ...    // deserializing
      m_pCall->unInitialize();			// closes the connection
}

changing this to

AxisService::AxisService() {}
 
AxisService::~AxisService() {}

AxisService::init() {
	m_pCall->initialize(CPP_DOC_PROVIDER);     // open the connection
      m_isInitialized = true; 
}

AxisService::deInit() {
      m_pCall->unInitialize();			// closes the connection	
      m_isInitialized = false; 
}

AxisService::setValue(int val) {
	if (!m_isInitialized)
		m_pCall->initialize(CPP_DOC_PROVIDER);     // open the connection
      ...    // serializing
	m_pCall->invoke();
      ...    // deserializing
      if (!m_isInitialized)
      	m_pCall->unInitialize();			// closes the connection
}

you would have in principle full control over the 
connection management. I'm not sure whether this works with
the current code, but this is something you could try
without changing the axis libraries.

Carsten

-----Original Message-----
From: Joe Love [mailto:joelove@lac.uic.edu]
Sent: Thursday, April 21, 2005 1:06 PM
To: axis-c-user@ws.apache.org
Subject: issues establishing a persistent connection


Is there a procedure for getting axis to establish persistent 
connections, so that calls to methods in a service will use the same 
connection, rather than establishing their own connection?

Right now, I can have code along the lines of the following:

AxisService as;
as.setvalue(5);
int val = as.getvalue();

Every call establishes a new connection to the server; opens up a new 
port on the client side, creates a new tcp connection to the server, 
etc).  This is problematic, because I can't retrieve data I may have set 
already.  In the above example, if getvalue() returns the value stored 
by setvalue(), I cannot retrieve the value set.

There was a previous email about persistent connections which suggested 
that they were the default behavior, however, my testing is not showing 
that axis is behaving this way.

I'm not sure what information would be useful in trying to understand 
what is happening here, but I can provide any information that may be of 
interest.

Thanks,
-Joe

Mime
View raw message