Author: vanto
Date: Tue Dec 16 16:06:44 2008
New Revision: 727227
URL: http://svn.apache.org/viewvc?rev=727227&view=rev
Log:
fixing ODE-465 in trunk.
Modified:
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSAEndpoint.java
ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSDL20Endpoint.java
ode/trunk/utils/src/main/java/org/apache/ode/utils/Namespaces.java
Modified:
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java
URL:
http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java?rev=727227&r1=727226&r2=727227&view=diff
==============================================================================
---
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java
(original)
+++
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionInHandler.java
Tue Dec 16 16:06:44 2008
@@ -49,12 +49,16 @@
if (__log.isDebugEnabled())
__log.debug("Found a header in incoming message, checking if
there are endpoints there.");
// Checking if a session identifier has been provided for a
stateful endpoint
- OMElement wsaToSession = header.getFirstChildWithName(new
QName(Namespaces.INTALIO_SESSION_NS, "session"));
+ OMElement wsaToSession = header.getFirstChildWithName(new
QName(Namespaces.ODE_SESSION_NS, "session"));
+ if (wsaToSession == null) {
+ // perhaps there is an old intalio header?
+ wsaToSession = header.getFirstChildWithName(new
QName(Namespaces.INTALIO_SESSION_NS, "session"));
+ }
if (wsaToSession != null) {
// Building an endpoint supposed to target the right instance
Document doc = DOMUtils.newDocument();
Element serviceEpr =
doc.createElementNS(Namespaces.WS_ADDRESSING_NS, "EndpointReference");
- Element sessionId =
doc.createElementNS(Namespaces.INTALIO_SESSION_NS, "session");
+ Element sessionId =
doc.createElementNS(Namespaces.ODE_SESSION_NS, "session");
doc.appendChild(serviceEpr);
serviceEpr.appendChild(sessionId);
sessionId.setTextContent(wsaToSession.getText());
@@ -74,14 +78,18 @@
}
// Seeing if there's a callback, in case our client would be
stateful as well
- OMElement callback = header.getFirstChildWithName(new
QName(Namespaces.INTALIO_SESSION_NS, "callback"));
+ OMElement callback = header.getFirstChildWithName(new
QName(Namespaces.ODE_SESSION_NS, "callback"));
+ if (callback == null) {
+ // is there an old intalio header?
+ callback = header.getFirstChildWithName(new
QName(Namespaces.INTALIO_SESSION_NS, "callback"));
+ }
if (callback != null) {
- OMElement callbackSession = callback.getFirstChildWithName(new
QName(Namespaces.INTALIO_SESSION_NS, "session"));
+ OMElement callbackSession = callback.getFirstChildWithName(new
QName(callback.getNamespace().getNamespaceURI(), "session"));
if (callbackSession != null) {
// Building an endpoint that represents our client (we're
supposed to call him later on)
Document doc = DOMUtils.newDocument();
Element serviceEpr =
doc.createElementNS(Namespaces.WS_ADDRESSING_NS, "EndpointReference");
- Element sessionId =
doc.createElementNS(Namespaces.INTALIO_SESSION_NS, "session");
+ Element sessionId =
doc.createElementNS(Namespaces.ODE_SESSION_NS, "session");
doc.appendChild(serviceEpr);
serviceEpr.appendChild(sessionId);
sessionId.setTextContent(callbackSession.getText());
Modified:
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
URL:
http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java?rev=727227&r1=727226&r2=727227&view=diff
==============================================================================
---
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
(original)
+++
ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
Tue Dec 16 16:06:44 2008
@@ -57,7 +57,7 @@
if (otargetSession != null || ocallbackSession != null) {
SOAPHeader header = messageContext.getEnvelope().getHeader();
SOAPFactory factory = (SOAPFactory)
messageContext.getEnvelope().getOMFactory();
- OMNamespace intalioSessNS =
factory.createOMNamespace(Namespaces.INTALIO_SESSION_NS, "intalio");
+ OMNamespace intalioSessNS =
factory.createOMNamespace(Namespaces.ODE_SESSION_NS, "intalio");
OMNamespace wsAddrNS =
factory.createOMNamespace(Namespaces.WS_ADDRESSING_NS, "addr");
if (header == null) {
header =
factory.createSOAPHeader(messageContext.getEnvelope());
Modified:
ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSAEndpoint.java
URL:
http://svn.apache.org/viewvc/ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSAEndpoint.java?rev=727227&r1=727226&r2=727227&view=diff
==============================================================================
--- ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSAEndpoint.java
(original)
+++ ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSAEndpoint.java
Tue Dec 16 16:06:44 2008
@@ -50,7 +50,7 @@
}
public String getSessionId() {
- NodeList idNodes =
_eprElmt.getElementsByTagNameNS(Namespaces.INTALIO_SESSION_NS, "session");
+ NodeList idNodes =
_eprElmt.getElementsByTagNameNS(Namespaces.ODE_SESSION_NS, "session");
if (idNodes.getLength() > 0)
return idNodes.item(0).getTextContent();
else
@@ -58,11 +58,11 @@
}
public void setSessionId(String sessionId) {
- NodeList idList =
_eprElmt.getElementsByTagNameNS(Namespaces.INTALIO_SESSION_NS, "session");
+ NodeList idList =
_eprElmt.getElementsByTagNameNS(Namespaces.ODE_SESSION_NS, "session");
if (idList.getLength() > 0)
idList.item(0).setTextContent(sessionId);
else {
- Element sessElmt =
_eprElmt.getOwnerDocument().createElementNS(Namespaces.INTALIO_SESSION_NS,
"session");
+ Element sessElmt =
_eprElmt.getOwnerDocument().createElementNS(Namespaces.ODE_SESSION_NS,
"session");
sessElmt.setTextContent(sessionId);
_eprElmt.appendChild(sessElmt);
}
@@ -190,7 +190,7 @@
Element addrElmt = doc.createElementNS(Namespaces.WS_ADDRESSING_NS,
"Address");
addrElmt.setTextContent((String) eprMap.get(ADDRESS));
if (eprMap.get(SESSION) != null) {
- Element sessElmt =
doc.createElementNS(Namespaces.INTALIO_SESSION_NS, "session");
+ Element sessElmt = doc.createElementNS(Namespaces.ODE_SESSION_NS,
"session");
sessElmt.setTextContent((String) eprMap.get(SESSION));
_eprElmt.appendChild(sessElmt);
}
Modified:
ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSDL20Endpoint.java
URL:
http://svn.apache.org/viewvc/ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSDL20Endpoint.java?rev=727227&r1=727226&r2=727227&view=diff
==============================================================================
--- ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSDL20Endpoint.java
(original)
+++ ode/trunk/il-common/src/main/java/org/apache/ode/il/epr/WSDL20Endpoint.java
Tue Dec 16 16:06:44 2008
@@ -41,17 +41,17 @@
public String getSessionId() {
Element endpointElmt =
(Element)_serviceElmt.getElementsByTagNameNS(Namespaces.WSDL_20,
"endpoint").item(0);
- NodeList idNodes =
endpointElmt.getElementsByTagNameNS(Namespaces.INTALIO_SESSION_NS, "session");
+ NodeList idNodes =
endpointElmt.getElementsByTagNameNS(Namespaces.ODE_SESSION_NS, "session");
if (idNodes.getLength() > 0) return idNodes.item(0).getTextContent();
else return null;
}
public void setSessionId(String sessionId) {
Element endpointElmt =
(Element)_serviceElmt.getElementsByTagNameNS(Namespaces.WSDL_20,
"endpoint").item(0);
- NodeList idList =
endpointElmt.getElementsByTagNameNS(Namespaces.INTALIO_SESSION_NS, "session");
+ NodeList idList =
endpointElmt.getElementsByTagNameNS(Namespaces.ODE_SESSION_NS, "session");
if (idList.getLength() > 0) idList.item(0).setTextContent(sessionId);
else {
- Element sessElmt =
_serviceElmt.getOwnerDocument().createElementNS(Namespaces.INTALIO_SESSION_NS,
"session");
+ Element sessElmt =
_serviceElmt.getOwnerDocument().createElementNS(Namespaces.ODE_SESSION_NS,
"session");
sessElmt.setTextContent(sessionId);
endpointElmt.appendChild(sessElmt);
}
@@ -122,7 +122,7 @@
endpoint.setAttribute("binding", "");
if (eprMap.get(ADDRESS) != null) endpoint.setAttribute("address", (String)
eprMap.get(ADDRESS));
if (eprMap.get(SESSION) != null) {
- Element session = doc.createElementNS(Namespaces.INTALIO_SESSION_NS,
"session");
+ Element session = doc.createElementNS(Namespaces.ODE_SESSION_NS,
"session");
session.setTextContent((String) eprMap.get(SESSION));
endpoint.appendChild(session);
}
Modified: ode/trunk/utils/src/main/java/org/apache/ode/utils/Namespaces.java
URL:
http://svn.apache.org/viewvc/ode/trunk/utils/src/main/java/org/apache/ode/utils/Namespaces.java?rev=727227&r1=727226&r2=727227&view=diff
==============================================================================
--- ode/trunk/utils/src/main/java/org/apache/ode/utils/Namespaces.java
(original)
+++ ode/trunk/utils/src/main/java/org/apache/ode/utils/Namespaces.java Tue Dec
16 16:06:44 2008
@@ -59,6 +59,7 @@
public static final String ODE_PMAPI =
"http://www.apache.org/ode/pmapi/types/2006/08/02/";
public static final String ODE_EXTENSION_NS =
"http://www.apache.org/ode/type/extension";
public static final String ODE_HTTP_EXTENSION_NS =
"http://www.apache.org/ode/type/extension/http";
+ public static final String ODE_SESSION_NS =
"http://www.intalio.com/type/session";
public static final String INTALIO_SESSION_NS =
"http://www.intalio.com/type/session";
}