Author: midon
Date: Fri Oct 17 17:18:52 2008
New Revision: 705802
URL: http://svn.apache.org/viewvc?rev=705802&view=rev
Log:
ODE-388: use SOAPHeaderBlock in header to avoid ClassCastException with Rampart
Modified:
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
Modified:
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
URL:
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java?rev=705802&r1=705801&r2=705802&view=diff
==============================================================================
---
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
(original)
+++
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/SessionOutHandler.java
Fri Oct 17 17:18:52 2008
@@ -23,6 +23,7 @@
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.soap.SOAPFactory;
import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.handlers.AbstractHandler;
@@ -65,32 +66,32 @@
WSAEndpoint targetEpr =
EndpointFactory.convertToWSA((MutableEndpoint) otargetSession);
- OMElement to = factory.createOMElement("To", wsAddrNS);
+ OMElement to = factory.createSOAPHeaderBlock("To", wsAddrNS);
header.addChild(to);
to.setText(targetEpr.getUrl());
String action = messageContext.getSoapAction();
- OMElement wsaAction = factory.createOMElement("Action",
wsAddrNS);
+ OMElement wsaAction = factory.createSOAPHeaderBlock("Action",
wsAddrNS);
header.addChild(wsaAction);
wsaAction.setText(action);
// we only set the ReplyTo and MessageID headers if doing
Request-Response
org.apache.axis2.addressing.EndpointReference replyToEpr =
messageContext.getReplyTo();
if (replyToEpr != null) {
- OMElement replyTo = factory.createOMElement("ReplyTo",
wsAddrNS);
+ OMElement replyTo =
factory.createSOAPHeaderBlock("ReplyTo", wsAddrNS);
OMElement address = factory.createOMElement("Address",
wsAddrNS);
replyTo.addChild(address);
header.addChild(replyTo);
address.setText(replyToEpr.getAddress());
String messageId = messageContext.getMessageID();
- OMElement messageIdElem =
factory.createOMElement("MessageID", wsAddrNS);
+ OMElement messageIdElem =
factory.createSOAPHeaderBlock("MessageID", wsAddrNS);
header.addChild(messageIdElem);
messageIdElem.setText(messageId);
}
if (targetEpr.getSessionId() != null) {
- OMElement session = factory.createOMElement("session",
intalioSessNS);
+ OMElement session =
factory.createSOAPHeaderBlock("session", intalioSessNS);
header.addChild(session);
session.setText(targetEpr.getSessionId());
}
@@ -99,7 +100,7 @@
if (ocallbackSession != null && ocallbackSession instanceof
MutableEndpoint) {
WSAEndpoint callbackEpr =
EndpointFactory.convertToWSA((MutableEndpoint) ocallbackSession);
- OMElement callback = factory.createOMElement("callback",
intalioSessNS);
+ OMElement callback = factory.createSOAPHeaderBlock("callback",
intalioSessNS);
header.addChild(callback);
OMElement address = factory.createOMElement("Address",
wsAddrNS);
callback.addChild(address);