[
https://issues.apache.org/jira/browse/SYNAPSE-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
kumaran venkatesan updated SYNAPSE-224:
---------------------------------------
Description:
When i tried to extract the header information through the message context
object in the custom mediator giving null value for
"axis2MessageCtx.getProperty(HTTPConstants.HEADER_USER_AGENT"
public class SessionMediator implements Mediator {
private static final Log log =
LogFactory.getLog(DiscountQuoteMediator.class);
public SessionMediator(){}
public boolean mediate(MessageContext mc) {
Axis2MessageContext axis2mc = (Axis2MessageContext)mc;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2mc.getAxis2MessageContext();
System.out.println("User Agent : "
+axis2MessageCtx.getProperty(HTTPConstants.HEADER_USER_AGENT));
return true;
}
was:
When i tried to extract the header information through the message context
object in the custom mediator giving null pointer exception.
public class SessionMediator implements Mediator {
private static final Log log =
LogFactory.getLog(DiscountQuoteMediator.class);
public SessionMediator(){}
public boolean mediate(MessageContext mc) {
Axis2MessageContext axis2mc = (Axis2MessageContext)mc;
org.apache.axis2.context.MessageContext axis2MessageCtx =
axis2mc.getAxis2MessageContext();
System.out.println("User Agent : "
+axis2MessageCtx.getProperty(HTTPConstants.HEADER_USER_AGENT));
return true;
}
> Not able to get the http header information in the custom mediators using the
> Message Context object
> ----------------------------------------------------------------------------------------------------
>
> Key: SYNAPSE-224
> URL: https://issues.apache.org/jira/browse/SYNAPSE-224
> Project: Synapse
> Issue Type: Bug
> Components: Extension Mediators
> Reporter: kumaran venkatesan
>
> When i tried to extract the header information through the message context
> object in the custom mediator giving null value for
> "axis2MessageCtx.getProperty(HTTPConstants.HEADER_USER_AGENT"
> public class SessionMediator implements Mediator {
> private static final Log log =
> LogFactory.getLog(DiscountQuoteMediator.class);
> public SessionMediator(){}
> public boolean mediate(MessageContext mc) {
>
> Axis2MessageContext axis2mc = (Axis2MessageContext)mc;
> org.apache.axis2.context.MessageContext axis2MessageCtx =
> axis2mc.getAxis2MessageContext();
> System.out.println("User Agent : "
> +axis2MessageCtx.getProperty(HTTPConstants.HEADER_USER_AGENT));
>
> return true;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]