public void setSoapAction(String string) { axis2MessageContext.setSoapAction(string); }
public void setSoapAction(String string) { axis2MessageContext.setSoapAction(string); }
public void setSOAPAction(String SOAPAction) { msgContext.setSoapAction(SOAPAction); }
public static void processContentTypeForAction(String contentType, MessageContext msgContext) { //Check for action header and set it in as soapAction in MessageContext int index = contentType.indexOf("action"); if (index > -1) { String transientString = contentType.substring(index, contentType.length()); int equal = transientString.indexOf("="); int firstSemiColon = transientString.indexOf(";"); String soapAction; // This will contain "" in the string if (firstSemiColon > -1) { soapAction = transientString.substring(equal + 1, firstSemiColon); } else { soapAction = transientString.substring(equal + 1, transientString.length()); } if ((soapAction != null) && soapAction.startsWith("\"") && soapAction.endsWith("\"")) { soapAction = soapAction .substring(1, soapAction.length() - 1); } msgContext.setSoapAction(soapAction); } }
public static void processContentTypeForAction(String contentType, MessageContext msgContext) { //Check for action header and set it in as soapAction in MessageContext int index = contentType.indexOf("action"); if (index > -1) { String transientString = contentType.substring(index, contentType.length()); int equal = transientString.indexOf("="); int firstSemiColon = transientString.indexOf(";"); String soapAction; // This will contain "" in the string if (firstSemiColon > -1) { soapAction = transientString.substring(equal + 1, firstSemiColon); } else { soapAction = transientString.substring(equal + 1, transientString.length()); } if ((soapAction != null) && soapAction.startsWith("\"") && soapAction.endsWith("\"")) { soapAction = soapAction .substring(1, soapAction.length() - 1); } msgContext.setSoapAction(soapAction); } }
@Override protected MessageContext createOutputMessageContext(MessageContext inMsg, ProcessingContext processingContext) throws AxisFault { MessageContext outputContext = null; OMElement responseMessage = processingContext.getRespMessage(); if (responseMessage != null) { outputContext = super.createOutputMessageContext(inMsg, processingContext); String responseAction = String.format("%s/%s", NameSpaceConstants.WSE_NS.getNamespaceURI(), responseMessage.getLocalName()); outputContext.setSoapAction(responseAction); } return outputContext; } }
@Override protected MessageContext createOutputMessageContext(MessageContext inMsg, ProcessingContext processingContext) throws AxisFault { MessageContext outputContext = null; OMElement responseMessage = processingContext.getRespMessage(); if (responseMessage != null) { outputContext = super.createOutputMessageContext(inMsg, processingContext); String responseAction = String.format("%s/%s", NameSpaceConstants.WSE_NS.getNamespaceURI(), responseMessage.getLocalName()); outputContext.setSoapAction(responseAction); } return outputContext; } }
protected void handleResponse(MessageContext responseMessageContext) throws AxisFault { responseMessageContext.setSoapAction(null); // for http transport the soap envelop is not build. but for smtp transport // it is build. so frist we check whether the soap envelop is build or // not. SOAPEnvelope resenvelope = responseMessageContext.getEnvelope(); if (resenvelope == null) { InputStream inStream = (InputStream) responseMessageContext.getProperty(MessageContext.TRANSPORT_IN); // we don't care about the situation where input stream is null. // this means this message has lost for some reason. for mercury we ignore it. if (inStream != null) { resenvelope = TransportUtils.createSOAPMessage(responseMessageContext); if (resenvelope != null) { responseMessageContext.setEnvelope(resenvelope); } else { throw new AxisFault(Messages .getMessage("blockingInvocationExpectsResponse")); } } } if (resenvelope != null) { AxisEngine.receive(responseMessageContext); } }
/** * Processes the HTTP GET request and builds the SOAP info-set of the REST message * * @param msgContext The MessageContext of the Request Message * @param out The output stream of the response * @param soapAction SoapAction of the request * @param requestURI The URL that the request came to * @throws AxisFault - Thrown in case a fault occurs */ public static void processURLRequest(MessageContext msgContext, OutputStream out, String soapAction, String requestURI) throws AxisFault { if ((soapAction != null) && soapAction.startsWith("\"") && soapAction.endsWith("\"")) { soapAction = soapAction.substring(1, soapAction.length() - 1); } msgContext.setSoapAction(soapAction); msgContext.setTo(new EndpointReference(requestURI)); msgContext.setProperty(MessageContext.TRANSPORT_OUT, out); msgContext.setServerSide(true); msgContext.setDoingREST(true); msgContext.setEnvelope(new SOAP11Factory().getDefaultEnvelope()); msgContext.setProperty(NhttpConstants.NO_ENTITY_BODY, Boolean.TRUE); AxisEngine.receive(msgContext); }
/** * When synchronous send() gets back a response MessageContext, this is the workhorse method which processes it. * * @param responseMessageContext the active response MessageContext * @throws AxisFault if something went wrong */ protected void handleResponse(final MessageContext responseMessageContext) throws AxisFault { // Options object reused above so soapAction needs to be removed so // that soapAction+wsa:Action on response don't conflict responseMessageContext.setSoapAction(null); if (responseMessageContext.getEnvelope() == null) { try { final SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(responseMessageContext); if (resenvelope != null) responseMessageContext.setEnvelope(resenvelope); } catch (final AxisFault af) { // This AxisFault indicates that there was no response received. Because this is allowd in ebMS // exchanges we just ignore this. } } SOAPEnvelope resenvelope = responseMessageContext.getEnvelope(); if (resenvelope != null) { AxisEngine.receive(responseMessageContext); if (responseMessageContext.getReplyTo() != null) { sc.setTargetEPR(responseMessageContext.getReplyTo()); } } }
msgCtx.setSoapAction(soapAction);
public void processNonEntityEnclosingRESTHandler(SOAPEnvelope soapEnvelope, MessageContext msgContext, boolean injectToAxis2Engine) { String soapAction = request.getHeaders().get(SOAP_ACTION_HEADER); if ((soapAction != null) && soapAction.startsWith("\"") && soapAction.endsWith("\"")) { soapAction = soapAction.substring(1, soapAction.length() - 1); } msgContext.setSoapAction(soapAction); msgContext.setTo(new EndpointReference(request.getUri())); msgContext.setServerSide(true); msgContext.setDoingREST(true); if (!(request.isEntityEnclosing())) { msgContext.setProperty(PassThroughConstants.NO_ENTITY_BODY, Boolean.TRUE); } try { if(soapEnvelope == null){ msgContext.setEnvelope(new SOAP11Factory().getDefaultEnvelope()); }else{ msgContext.setEnvelope(soapEnvelope); } if (injectToAxis2Engine) { AxisEngine.receive(msgContext); } } catch (AxisFault axisFault) { handleException("Error processing " + request.getMethod() + " request for : " + request.getUri(), axisFault); } catch (Exception e) { String encodedURL = StringEscapeUtils.escapeHtml(request.getUri()); handleException("Error processing " + request.getMethod() + " request for : " + encodedURL + ". ", e); } }
/** * Dispatch the message to the target endpoint * * @param soapEnvelope Soap Enevlop with message * @param responseAction WSE action for the response * @param mc Message Context * @param isFault Whether a Fault message must be sent * @throws AxisFault Thrown by the axis2 engine. */ private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction, MessageContext mc, boolean isFault) throws AxisFault { MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc); rmc.getOperationContext().addMessageContext(rmc); replicateState(mc); rmc.setEnvelope(soapEnvelope); rmc.setWSAAction(responseAction); rmc.setSoapAction(responseAction); if (isFault) { AxisEngine.sendFault(rmc); } else { AxisEngine.send(rmc); } } }
/** * Dispatch the message to the target endpoint * * @param soapEnvelope Soap Enevlop with message * @param responseAction WSE action for the response * @param mc Message Context * @param isFault Whether a Fault message must be sent * @throws AxisFault Thrown by the axis2 engine. */ private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction, MessageContext mc, boolean isFault) throws AxisFault { MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc); rmc.getOperationContext().addMessageContext(rmc); replicateState(mc); rmc.setEnvelope(soapEnvelope); rmc.setWSAAction(responseAction); rmc.setSoapAction(responseAction); if (isFault) { AxisEngine.sendFault(rmc); } else { AxisEngine.send(rmc); } }
/** * Dispatch the message to the target endpoint * * @param soapEnvelope Soap Enevlop with message * @param responseAction WSE action for the response * @param mc Message Context * @param faultMessage Fault message * @throws AxisFault AxisFault */ private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction, MessageContext mc, boolean faultMessage) throws AxisFault { MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc); rmc.getOperationContext().addMessageContext(rmc); rmc.setEnvelope(soapEnvelope); rmc.setWSAAction(responseAction); rmc.setSoapAction(responseAction); rmc.setProperty(SynapseConstants.ISRESPONSE_PROPERTY, Boolean.TRUE); if (faultMessage) { AxisEngine.sendFault(rmc); } else { AxisEngine.send(rmc); } }
/** * Dispatch the message to the target endpoint * * @param soapEnvelope Soap Enevlop with message * @param responseAction WSE action for the response * @param mc Message Context * @param isFault Whether a Fault message must be sent * @throws AxisFault Thrown by the axis2 engine. */ private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction, MessageContext mc, boolean isFault) throws AxisFault { MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc); rmc.getOperationContext().addMessageContext(rmc); replicateState(mc); rmc.setEnvelope(soapEnvelope); rmc.setWSAAction(responseAction); rmc.setSoapAction(responseAction); if (isFault) { AxisEngine.sendFault(rmc); } else { AxisEngine.send(rmc); } }
/** * Dispatch the message to the target endpoint * * @param soapEnvelope Soap Enevlop with message * @param responseAction WSE action for the response * @param mc Message Context * @param isFault Whether a Fault message must be sent * @throws AxisFault Thrown by the axis2 engine. */ private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction, MessageContext mc, boolean isFault) throws AxisFault { MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc); rmc.getOperationContext().addMessageContext(rmc); replicateState(mc); rmc.setEnvelope(soapEnvelope); rmc.setWSAAction(responseAction); rmc.setSoapAction(responseAction); if (isFault) { AxisEngine.sendFault(rmc); } else { AxisEngine.send(rmc); } } }
/** * Dispatch the message to the target endpoint * * @param soapEnvelope Soap Enevlop with message * @param responseAction WSE action for the response * @param mc Message Context * @param faultMessage Fault message * @throws AxisFault AxisFault */ private void dispatchResponse(SOAPEnvelope soapEnvelope, String responseAction, MessageContext mc, boolean faultMessage) throws AxisFault { MessageContext rmc = MessageContextBuilder.createOutMessageContext(mc); rmc.getOperationContext().addMessageContext(rmc); rmc.setEnvelope(soapEnvelope); rmc.setWSAAction(responseAction); rmc.setSoapAction(responseAction); rmc.setProperty(SynapseConstants.ISRESPONSE_PROPERTY, Boolean.TRUE); if (faultMessage) { AxisEngine.sendFault(rmc); } else { AxisEngine.send(rmc); } }
public MessageContext createMessageContext() throws AxisFault { MessageContext msgContext = listener.createMessageContext(); if (service != null) { msgContext.setAxisService(service); // find the operation for the message, or default to one Parameter operationParam = service.getParameter(BaseConstants.OPERATION_PARAM); QName operationQName = ( operationParam != null ? BaseUtils.getQNameFromString(operationParam.getValue()) : BaseConstants.DEFAULT_OPERATION); AxisOperation operation = service.getOperation(operationQName); if (operation != null) { msgContext.setAxisOperation(operation); msgContext.setAxisMessage( operation.getMessage(WSDL2Constants.MESSAGE_LABEL_IN)); msgContext.setSoapAction("urn:" + operation.getName().getLocalPart()); } } return msgContext; } }
public MessageContext createMessageContext() throws AxisFault { MessageContext msgContext = listener.createMessageContext(); if (service != null) { msgContext.setAxisService(service); // find the operation for the message, or default to one Parameter operationParam = service.getParameter(BaseConstants.OPERATION_PARAM); QName operationQName = ( operationParam != null ? BaseUtils.getQNameFromString(operationParam.getValue()) : BaseConstants.DEFAULT_OPERATION); AxisOperation operation = service.getOperation(operationQName); if (operation != null) { msgContext.setAxisOperation(operation); msgContext.setAxisMessage( operation.getMessage(WSDL2Constants.MESSAGE_LABEL_IN)); msgContext.setSoapAction("urn:" + operation.getName().getLocalPart()); } } return msgContext; } }