@Override public void cleanup(MessageContext msgContext) throws AxisFault { log.trace("cleanup() releasing connection"); OperationContext opContext = msgContext.getOperationContext(); if (opContext != null) { InputStream in = (InputStream)opContext.getProperty(MessageContext.TRANSPORT_IN); if (in != null) { try { in.close(); } catch (IOException ex) { // Ignore } } } // guard against multiple calls msgContext.removeProperty(HTTPConstants.HTTP_METHOD); }
@Override public void cleanup(MessageContext msgContext) throws AxisFault { log.trace("cleanup() releasing connection"); OperationContext opContext = msgContext.getOperationContext(); if (opContext != null) { InputStream in = (InputStream)opContext.getProperty(MessageContext.TRANSPORT_IN); if (in != null) { try { in.close(); } catch (IOException ex) { // Ignore } } } // guard against multiple calls msgContext.removeProperty(HTTPConstants.HTTP_METHOD); }
/** * Utility method to query CharSetEncoding. First look in the * MessageContext. If it's not there look in the OpContext. Use the defualt, * if it's not given in either contexts. * * @param msgContext the active MessageContext * @return String the CharSetEncoding */ public static String getCharSetEncoding(MessageContext msgContext) { String charSetEnc = (String) msgContext .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING); if (charSetEnc == null) { OperationContext opctx = msgContext.getOperationContext(); if (opctx != null) { charSetEnc = (String) opctx .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING); } /** * If the char set enc is still not found use the default */ if (charSetEnc == null) { charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING; } } return charSetEnc; }
/** * Utility method to query CharSetEncoding. First look in the * MessageContext. If it's not there look in the OpContext. Use the defualt, * if it's not given in either contexts. * * @param msgContext the active MessageContext * @return String the CharSetEncoding */ public static String getCharSetEncoding(MessageContext msgContext) { String charSetEnc = (String) msgContext .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING); if (charSetEnc == null) { OperationContext opctx = msgContext.getOperationContext(); if (opctx != null) { charSetEnc = (String) opctx .getProperty(Constants.Configuration.CHARACTER_SET_ENCODING); } /** * If the char set enc is still not found use the default */ if (charSetEnc == null) { charSetEnc = MessageContext.DEFAULT_CHAR_SET_ENCODING; } } return charSetEnc; }
public synchronized static TwilioRestClient getTwilioRestClient(MessageContext messageContext) throws ConnectException { // Authorization details // Get parameters from the messageContext // Getting Transport Headers Axis2MessageContext axis2smc = (Axis2MessageContext) messageContext; axis2smc.getAxis2MessageContext(); String accountSid = (String) axis2smc.getAxis2MessageContext().getOperationContext() .getProperty("twilio.accountSid"); String authToken = (String) axis2smc.getAxis2MessageContext().getOperationContext() .getProperty("twilio.authToken"); return new TwilioRestClient(accountSid, authToken); }
public synchronized static NoteStoreClient getNoteStoreClient(MessageContext ctxt) throws TException, EDAMUserException, EDAMSystemException { Axis2MessageContext axis2mc = (Axis2MessageContext)ctxt; axis2mc.getAxis2MessageContext(); String devToken = (String)axis2mc.getAxis2MessageContext().getOperationContext().getProperty("evernote.devToken"); String noteStoreUrl = (String)axis2mc.getAxis2MessageContext().getOperationContext().getProperty("evernote.noteStoreUrl"); String devTokenType = (String)axis2mc.getAxis2MessageContext().getOperationContext().getProperty("evernote.devTokenType"); EvernoteAuth auth = null; if(devTokenType.equalsIgnoreCase("PRODUCTION")) { auth = new EvernoteAuth(EvernoteService.PRODUCTION, devToken); } else if(devTokenType.equalsIgnoreCase("YINXIANG")) { auth = new EvernoteAuth(EvernoteService.YINXIANG, devToken); } else if (devTokenType.equalsIgnoreCase("SANDBOX")){ auth = new EvernoteAuth(EvernoteService.SANDBOX, devToken); } if (auth != null) { auth.setNoteStoreUrl(noteStoreUrl); } ClientFactory factory = new ClientFactory(auth); return factory.createNoteStoreClient(); }
propertyObj = axis2smc.getAxis2MessageContext().getProperty(property); } else if (XMLConfigConstants.SCOPE_OPERATION.equals(scope)) { propertyObj = axis2smc.getAxis2MessageContext().getOperationContext().getProperty(property);
} else if (SynapseXPathConstants.OPERATION_SCOPE_VARIABLE_PREFIX.equals(prefix)) { Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx; return axis2smc.getAxis2MessageContext().getOperationContext().getProperty(localName); } else if (SynapseXPathConstants.SYSTEM_SCOPE_VARIABLE_PREFIX.equals(prefix)) { String propVal = System.getProperty(localName);
String respWritten = ""; if (msgContext.getOperationContext() != null) { respWritten = (String) msgContext.getOperationContext().getProperty( Constants.RESPONSE_WRITTEN);
org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext(); return axis2smc.getAxis2MessageContext().getOperationContext().getProperty(key); }else if (XMLConfigConstants.SCOPE_REGISTRY.equals(scope)) { String[] regParam = key.split("@");
if (oc != null) { flagFromContext = context.getOperationContext() .getProperty(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS);
if (oc != null) { flagFromContext = context.getOperationContext() .getProperty(Constants.Configuration.SEND_STACKTRACE_DETAILS_WITH_FAULTS);
public void sendAck(MessageContext msgContext) { String respWritten = ""; if (msgContext.getOperationContext() != null) { respWritten = (String) msgContext.getOperationContext().getProperty( Constants.RESPONSE_WRITTEN);
.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING)); responseMessageContext.setProperty(Constants.Configuration.CONTENT_TYPE, requestMsgOpCtx .getProperty(Constants.Configuration.CONTENT_TYPE)); responseMessageContext.setProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE, requestMsgOpCtx .getProperty(HTTPConstants.MTOM_RECEIVED_CONTENT_TYPE));
obj = operationContext.getProperty(name);
if (opContext != null) { charSetEnc = (String) opContext.getProperty(MessageContext.CHARACTER_SET_ENCODING);
if (opContext != null) { charSetEnc = (String) opContext.getProperty(MessageContext.CHARACTER_SET_ENCODING);
obj = operationContext.getProperty(name);