public AxisOperation findOperation(AxisService svc, MessageContext mc) throws AxisFault { return svc.getOperation(SynapseConstants.SYNAPSE_OPERATION_NAME); } }
@Override public AxisOperation findOperation(final AxisService service, final MessageContext msgCtx) throws AxisFault { return service.getOperation(new QName("Receive")); }
public OperationContext createOperationContext(QName name) { AxisOperation axisOp = axisService.getOperation(name); return createOperationContext(axisOp); }
public OperationContext createOperationContext(QName name) { AxisOperation axisOp = axisService.getOperation(name); return createOperationContext(axisOp); }
private AxisOperation getAxisOperation(String serviceName, String operationName) { return getAxisService(serviceName).getOperation(new QName(operationName)); }
/** * Checks if an operation with the JBI exchange operation name exists in the * Axis Service. * * @param exchange * the exchange * @param axisService * the target Axis service * @return true if the exchange's operation exists in the Axis service, * false otherwise */ protected boolean checkOperation(Exchange exchange, AxisService axisService) { AxisOperation op = axisService.getOperation(exchange.getOperation()); return op != null; }
public void removeOperation(QName opName) { AxisOperation operation = getOperation(opName); if (operation != null) { removeChild(opName); ArrayList<String> mappingList = operation.getWSAMappingList(); if (mappingList != null) { for (int i = 0; i < mappingList.size(); i++) { String actionMapping = (String) mappingList.get(i); operationsAliasesMap.remove(actionMapping); invalidOperationsAliases.remove(actionMapping); } } operationsAliasesMap.remove(operation.getName().getLocalPart()); invalidOperationsAliases.remove(operation.getName().getLocalPart()); } }
public AxisOperation findOperation(AxisService svc, MessageContext mc) throws AxisFault { AxisOperation operation = svc.getOperation(SynapseConstants.SYNAPSE_OPERATION_NAME); if(operation == null && mc.getAxisService() != null){ operation = processOperationValidation(svc); } return operation; }
public void removeOperation(QName opName) { AxisOperation operation = getOperation(opName); if (operation != null) { removeChild(opName); ArrayList<String> mappingList = operation.getWSAMappingList(); if (mappingList != null) { for (int i = 0; i < mappingList.size(); i++) { String actionMapping = (String) mappingList.get(i); operationsAliasesMap.remove(actionMapping); invalidOperationsAliases.remove(actionMapping); } } operationsAliasesMap.remove(operation.getName().getLocalPart()); invalidOperationsAliases.remove(operation.getName().getLocalPart()); } }
/** * Get the axis operation from the operation name used by the Synapse service (for message mediation). * * @param svc axis service * @param mc messageContext message context * @return axis operation for the message context */ public static AxisOperation findOperation(AxisService svc, MessageContext mc) { AxisOperation operation = svc.getOperation(NhttpConstants.SYNAPSE_OPERATION_NAME); if (operation == null && mc.getAxisService() != null) { operation = processOperationValidation(svc); } return operation; }
public void setPolicy(String serviceId, String operationId, OMElement policyElement) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("Invalid service : " + serviceId); } AxisOperation axisOperation = axisService.getOperation(new QName(operationId)); if (axisOperation == null) { throw new AxisFault("Invalid operation : " + operationId + " not available in service : " + serviceId); } Policy operationPolicy; try { operationPolicy = PolicyUtil.getPolicyFromOMElement(policyElement); } catch (RuntimeException ex) { throw new RuntimeException("Cannot convert the OMElement to Policy", ex); } PolicyInclude operationPolicyInclude = axisOperation.getPolicyInclude(); operationPolicyInclude.setPolicy(operationPolicy); }
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) { try { if (axisEvent.equals(AxisEvent.SERVICE_DEPLOY) && axisService.getName().equals("ServiceAdmin")){ AxisOperation operation = axisService.getOperation(new QName("listServiceGroups")); ArrayList<Parameter> params = operation.getParameters(); for(Parameter param: params) { operation.removeParameter(param); } Parameter authAction = new Parameter("AuthorizationAction", "/permission/admin/manage/monitor/service"); operation.addParameter(authAction); } } catch (AxisFault axisFault) { axisFault.printStackTrace(); } }
public OMElement getPolicy(String serviceId, String operationId) throws AxisFault { AxisService axisService = getAxisConfig().getService(serviceId); if (axisService == null) { throw new AxisFault("Invalid service : " + serviceId); } AxisOperation axisOperation = axisService.getOperation(new QName( operationId)); if (axisOperation == null) { throw new AxisFault("Invalid operation : " + operationId + " not available in service : " + serviceId); } PolicyInclude operationPolicyInclude = axisOperation.getPolicyInclude(); Policy operationPolicy = operationPolicyInclude.getPolicy(); if (operationPolicy == null) { return PolicyUtil.getEmptyPolicyAsOMElement(); } return PolicyUtil.getPolicyAsOMElement(operationPolicy); }
public AxisOperation findOperation(AxisService service, MessageContext messageContext) throws AxisFault { EndpointReference toEPR = messageContext.getTo(); if (toEPR != null) { String filePart = toEPR.getAddress(); String operation = Utils.getOperationName(filePart, service.getName()); if (operation != null) { QName operationName = new QName(operation); log.debug(messageContext.getLogIDString() + " Checking for Operation using QName(target endpoint URI fragment) : " + operationName); return service.getOperation(operationName); } else { log.debug(messageContext.getLogIDString() + " Attempted to check for Operation using target endpoint URI, but the operation fragment was missing"); return null; } } else { log.debug(messageContext.getLogIDString() + " Attempted to check for Operation using null target endpoint URI"); return null; } }
private void sendRobust(org.apache.axis2.context.MessageContext axisOutMsgCtx, Options clientOptions, AxisService anonymousService, ServiceContext serviceCtx) throws AxisFault { AxisOperation axisAnonymousOperation = anonymousService.getOperation( new QName(AnonymousServiceFactory.OUT_ONLY_OPERATION)); OperationClient operationClient = axisAnonymousOperation.createClient( serviceCtx, clientOptions); operationClient.addMessageContext(axisOutMsgCtx); axisOutMsgCtx.setAxisMessage(axisAnonymousOperation.getMessage( WSDLConstants.MESSAGE_LABEL_OUT_VALUE)); operationClient.execute(true); axisOutMsgCtx.getTransportOut().getSender().cleanup(axisOutMsgCtx); }
private void sendRobust(org.apache.axis2.context.MessageContext axisOutMsgCtx, Options clientOptions, AxisService anonymousService, ServiceContext serviceCtx, MessageContext synapseInMsgCtx) throws AxisFault { this.invokeHandlers(synapseInMsgCtx, false); AxisOperation axisAnonymousOperation = anonymousService.getOperation(new QName(AnonymousServiceFactory.OUT_ONLY_OPERATION)); OperationClient operationClient = axisAnonymousOperation.createClient(serviceCtx, clientOptions); operationClient.addMessageContext(axisOutMsgCtx); axisOutMsgCtx.setAxisMessage( axisAnonymousOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE)); operationClient.execute(true); axisOutMsgCtx.getTransportOut().getSender().cleanup(axisOutMsgCtx); }
private org.apache.axis2.context.MessageContext sendReceive(org.apache.axis2.context.MessageContext axisOutMsgCtx, Options clientOptions, AxisService anonymousService, ServiceContext serviceCtx) throws AxisFault { AxisOperation axisAnonymousOperation = anonymousService.getOperation( new QName(AnonymousServiceFactory.OUT_IN_OPERATION)); OperationClient operationClient = axisAnonymousOperation.createClient( serviceCtx, clientOptions); operationClient.addMessageContext(axisOutMsgCtx); axisOutMsgCtx.setAxisMessage(axisAnonymousOperation.getMessage( WSDLConstants.MESSAGE_LABEL_OUT_VALUE)); operationClient.execute(true); org.apache.axis2.context.MessageContext resultMsgCtx = operationClient.getMessageContext( WSDLConstants.MESSAGE_LABEL_IN_VALUE); org.apache.axis2.context.MessageContext returnMsgCtx = new org.apache.axis2.context.MessageContext(); returnMsgCtx.setEnvelope(MessageHelper.cloneSOAPEnvelope(resultMsgCtx.getEnvelope())); returnMsgCtx.setProperty(SynapseConstants.HTTP_SENDER_STATUSCODE, resultMsgCtx.getProperty(SynapseConstants.HTTP_SENDER_STATUSCODE)); axisOutMsgCtx.getTransportOut().getSender().cleanup(axisOutMsgCtx); return returnMsgCtx; }
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; } }
public static OperationClient getOperationClient(BPELMessageContext partnerMessageContext, ConfigurationContext clientConfigCtx) throws AxisFault { AxisService anonymousService = AnonymousServiceFactory.getAnonymousService(partnerMessageContext.getService(), partnerMessageContext.getPort(), clientConfigCtx.getAxisConfiguration(), partnerMessageContext.getCaller()); anonymousService.engageModule(clientConfigCtx.getAxisConfiguration().getModule("UEPModule")); anonymousService.getParent().addParameter( BPELConstants.HIDDEN_SERVICE_PARAM, "true"); ServiceGroupContext sgc = new ServiceGroupContext( clientConfigCtx, (AxisServiceGroup) anonymousService.getParent()); ServiceContext serviceCtx = sgc.getServiceContext(anonymousService); // get a reference to the DYNAMIC operation of the Anonymous Axis2 service AxisOperation axisAnonymousOperation = anonymousService.getOperation( partnerMessageContext.isTwoWay() ? ServiceClient.ANON_OUT_IN_OP : ServiceClient.ANON_OUT_ONLY_OP); Options clientOptions = cloneOptions(partnerMessageContext.getInMessageContext().getOptions()); clientOptions.setExceptionToBeThrownOnSOAPFault(false); /* This value doesn't overrideend point config. */ clientOptions.setTimeOutInMilliSeconds(60000); return axisAnonymousOperation.createClient(serviceCtx, clientOptions); }