/** * Tests to see if the named property is set in the 'bag', returning * <code>false</code> if it is not present at all. * This is equivalent to <code>isPropertyTrue(propName, false)</code>. * * @param propName the name of the property to check * @return true or false, depending on the value of the property */ public boolean isPropertyTrue(String propName) { return isPropertyTrue(propName, false); }
/** * Tests to see if the named property is set in the 'bag', returning * <code>false</code> if it is not present at all. * This is equivalent to <code>isPropertyTrue(propName, false)</code>. * * @param propName the name of the property to check * @return true or false, depending on the value of the property */ public boolean isPropertyTrue(String propName) { return isPropertyTrue(propName, false); }
/** * Tests to see if the named property is set in the 'bag', returning * <code>false</code> if it is not present at all. * This is equivalent to <code>isPropertyTrue(propName, false)</code>. * * @param propName the name of the property to check * @return true or false, depending on the value of the property */ public boolean isPropertyTrue(String propName) { return isPropertyTrue(propName, false); }
private void doVisiting(MessageContext msgContext, HandlerIterationStrategy visitor) throws AxisFault { int i = 0 ; try { Enumeration enumeration = handlers.elements(); while (enumeration.hasMoreElements()) { Handler h = (Handler)enumeration.nextElement(); visitor.visit(h, msgContext); i++; } } catch( AxisFault f ) { // Something went wrong. If we haven't already put this fault // into the MessageContext's response message, do so and make sure // we only do it once. This allows onFault() methods to safely // set headers and such in the response message without them // getting stomped. if (!msgContext.isPropertyTrue(CAUGHTFAULT_PROPERTY)) { // Attach the fault to the response message; enabling access to the // fault details while inside the handler onFault methods. Message respMsg = new Message(f); msgContext.setResponseMessage(respMsg); msgContext.setProperty(CAUGHTFAULT_PROPERTY, Boolean.TRUE); } while( --i >= 0 ) ((Handler) handlers.elementAt( i )).onFault( msgContext ); throw f; } }
private void doVisiting(MessageContext msgContext, HandlerIterationStrategy visitor) throws AxisFault { int i = 0 ; try { Enumeration enumeration = handlers.elements(); while (enumeration.hasMoreElements()) { Handler h = (Handler)enumeration.nextElement(); visitor.visit(h, msgContext); i++; } } catch( AxisFault f ) { // Something went wrong. If we haven't already put this fault // into the MessageContext's response message, do so and make sure // we only do it once. This allows onFault() methods to safely // set headers and such in the response message without them // getting stomped. if (!msgContext.isPropertyTrue(CAUGHTFAULT_PROPERTY)) { // Attach the fault to the response message; enabling access to the // fault details while inside the handler onFault methods. Message respMsg = new Message(f); msgContext.setResponseMessage(respMsg); msgContext.setProperty(CAUGHTFAULT_PROPERTY, Boolean.TRUE); } while( --i >= 0 ) ((Handler) handlers.elementAt( i )).onFault( msgContext ); throw f; } }
public boolean shouldDoAutoTypes() { if(doAutoTypes != null) { return doAutoTypes.booleanValue(); } MessageContext msgContext = MessageContext.getCurrentContext(); if(msgContext != null) { if (msgContext.isPropertyTrue("axis.doAutoTypes") || (msgContext.getAxisEngine() != null && JavaUtils.isTrue(msgContext.getAxisEngine().getOption("axis.doAutoTypes")))) { doAutoTypes = Boolean.TRUE; } } if(doAutoTypes == null){ doAutoTypes = AxisProperties.getProperty("axis.doAutoTypes", "false") .equals("true") ? Boolean.TRUE : Boolean.FALSE; } return doAutoTypes.booleanValue(); }
/** Sets HTTP request headers based on the Axis message context. */ private void setHttpRequestHeaders(MessageContext msgContext, HttpRequest httpRequest) { @SuppressWarnings("unchecked") Map<Object, Object> requestHeaders = (Map<Object, Object>) msgContext.getProperty(HTTPConstants.REQUEST_HEADERS); if (requestHeaders != null) { for (Entry<Object, Object> headerEntry : requestHeaders.entrySet()) { Object headerKey = headerEntry.getKey(); if (headerKey == null) { continue; } String headerName = headerKey.toString().trim(); Object headerValue = headerEntry.getValue(); if (HTTPConstants.HEADER_AUTHORIZATION.equals(headerName) && (headerValue instanceof String)) { // HttpRequest expects the Authorization header to be a list of values, // so handle the case where it is simply a string. httpRequest.getHeaders().setAuthorization((String) headerValue); } else { httpRequest.getHeaders().set(headerName, headerValue); } } } if (msgContext.isPropertyTrue(HTTPConstants.MC_GZIP_REQUEST)) { httpRequest.getHeaders().setContentEncoding(HTTPConstants.COMPRESSION_GZIP); } }
private void doVisiting(MessageContext msgContext, HandlerIterationStrategy visitor) throws AxisFault { int i = 0 ; try { Enumeration enumeration = handlers.elements(); while (enumeration.hasMoreElements()) { Handler h = (Handler)enumeration.nextElement(); visitor.visit(h, msgContext); i++; } } catch( AxisFault f ) { // Something went wrong. If we haven't already put this fault // into the MessageContext's response message, do so and make sure // we only do it once. This allows onFault() methods to safely // set headers and such in the response message without them // getting stomped. if (!msgContext.isPropertyTrue(CAUGHTFAULT_PROPERTY)) { // Attach the fault to the response message; enabling access to the // fault details while inside the handler onFault methods. Message respMsg = new Message(f); msgContext.setResponseMessage(respMsg); msgContext.setProperty(CAUGHTFAULT_PROPERTY, Boolean.TRUE); } while( --i >= 0 ) ((Handler) handlers.elementAt( i )).onFault( msgContext ); throw f; } }
public boolean shouldDoAutoTypes() { if(doAutoTypes != null) { return doAutoTypes.booleanValue(); } MessageContext msgContext = MessageContext.getCurrentContext(); if(msgContext != null) { if (msgContext.isPropertyTrue("axis.doAutoTypes") || (msgContext.getAxisEngine() != null && JavaUtils.isTrue(msgContext.getAxisEngine().getOption("axis.doAutoTypes")))) { doAutoTypes = Boolean.TRUE; } } if(doAutoTypes == null){ doAutoTypes = AxisProperties.getProperty("axis.doAutoTypes", "false") .equals("true") ? Boolean.TRUE : Boolean.FALSE; } return doAutoTypes.booleanValue(); }
/** Sets HTTP request headers based on the Axis message context. */ private void setHttpRequestHeaders(MessageContext msgContext, HttpRequest httpRequest) { @SuppressWarnings("unchecked") Map<Object, Object> requestHeaders = (Map<Object, Object>) msgContext.getProperty(HTTPConstants.REQUEST_HEADERS); if (requestHeaders != null) { for (Entry<Object, Object> headerEntry : requestHeaders.entrySet()) { Object headerKey = headerEntry.getKey(); if (headerKey == null) { continue; } String headerName = headerKey.toString().trim(); Object headerValue = headerEntry.getValue(); if (HTTPConstants.HEADER_AUTHORIZATION.equals(headerName) && (headerValue instanceof String)) { // HttpRequest expects the Authorization header to be a list of values, // so handle the case where it is simply a string. httpRequest.getHeaders().setAuthorization((String) headerValue); } else { httpRequest.getHeaders().set(headerName, headerValue); } } } if (msgContext.isPropertyTrue(HTTPConstants.MC_GZIP_REQUEST)) { httpRequest.getHeaders().setContentEncoding(HTTPConstants.COMPRESSION_GZIP); } }
public boolean shouldDoAutoTypes() { if(doAutoTypes != null) { return doAutoTypes.booleanValue(); } MessageContext msgContext = MessageContext.getCurrentContext(); if(msgContext != null) { if (msgContext.isPropertyTrue("axis.doAutoTypes") || (msgContext.getAxisEngine() != null && JavaUtils.isTrue(msgContext.getAxisEngine().getOption("axis.doAutoTypes")))) { doAutoTypes = Boolean.TRUE; } } if(doAutoTypes == null){ doAutoTypes = AxisProperties.getProperty("axis.doAutoTypes", "false") .equals("true") ? Boolean.TRUE : Boolean.FALSE; } return doAutoTypes.booleanValue(); }
/** * Serialize a DOM Element */ public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { if (!(value instanceof Element)) throw new IOException(Messages.getMessage("cantSerialize01")); MessageContext mc = context.getMessageContext(); context.setWriteXMLType(null); boolean writeWrapper = (mc == null) || mc.isPropertyTrue("writeWrapperForElements", true); if (writeWrapper) context.startElement(name, attributes); context.writeDOMElement((Element)value); if (writeWrapper) context.endElement(); }
/** * Serialize a DOM Element */ public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { if (!(value instanceof Element)) throw new IOException(Messages.getMessage("cantSerialize01")); MessageContext mc = context.getMessageContext(); context.setWriteXMLType(null); boolean writeWrapper = (mc == null) || mc.isPropertyTrue("writeWrapperForElements", true); if (writeWrapper) context.startElement(name, attributes); context.writeDOMElement((Element)value); if (writeWrapper) context.endElement(); }
/** * Serialize a DOM Element */ public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { if (!(value instanceof Element)) throw new IOException(Messages.getMessage("cantSerialize01")); MessageContext mc = context.getMessageContext(); context.setWriteXMLType(null); boolean writeWrapper = (mc == null) || mc.isPropertyTrue("writeWrapperForElements", true); if (writeWrapper) context.startElement(name, attributes); context.writeDOMElement((Element)value); if (writeWrapper) context.endElement(); }
/** * {@inheritDoc} */ public void invoke(MessageContext msgContext) throws AxisFault { boolean setMustUnderstand = msgContext.isPropertyTrue(ENV_ADDRESSING_SET_MUST_UNDERSTAND); try { if (msgContext.isClient()) { if (!msgContext.getPastPivot()) { processClientRequest(msgContext, setMustUnderstand); } else { processClientResponse(msgContext); } } else { if (!msgContext.getPastPivot()) { processServerRequest(msgContext); } else { processServerResponse(msgContext, setMustUnderstand); } } } catch (Exception e) { LOG.error("Exception in AddressingHandler", e); throw AxisFault.makeFault(e); } }
msg = msgContext.getResponseMessage(); if (msg == null) { if (msgContext.isPropertyTrue(FAULT_ON_NO_RESPONSE, false)) { throw new AxisFault(Messages.getMessage("nullResponse00")); } else {
msg = msgContext.getResponseMessage(); if (msg == null) { if (msgContext.isPropertyTrue(FAULT_ON_NO_RESPONSE, false)) { throw new AxisFault(Messages.getMessage("nullResponse00")); } else {
msg = msgContext.getResponseMessage(); if (msg == null) { if (msgContext.isPropertyTrue(FAULT_ON_NO_RESPONSE, false)) { throw new AxisFault(Messages.getMessage("nullResponse00")); } else {
if (msgContext.isPropertyTrue(FAULT_ON_NO_RESPONSE, false)) { throw new AxisFault(Messages.getMessage("nullResponse00")); } else {
if (msgContext.isPropertyTrue(FAULT_ON_NO_RESPONSE, false)) { throw new AxisFault(Messages.getMessage("nullResponse00")); } else {