/** * @param msgctx * @throws org.apache.axis2.AxisFault */ public InvocationResponse invoke(MessageContext msgctx) throws AxisFault { AxisService axisService = msgctx.getAxisService(); if (axisService == null) { axisService = findService(msgctx); if (axisService != null) { if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("servicefound", axisService.getName())); } msgctx.setAxisService(axisService); } } return InvocationResponse.CONTINUE; } }
/** * @param msgctx * @throws org.apache.axis2.AxisFault */ public InvocationResponse invoke(MessageContext msgctx) throws AxisFault { AxisService axisService = msgctx.getAxisService(); if (axisService == null) { axisService = findService(msgctx); if (axisService != null) { if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) { log.debug(msgctx.getLogIDString() + " " + Messages.getMessage("servicefound", axisService.getName())); } msgctx.setAxisService(axisService); } } return InvocationResponse.CONTINUE; } }
protected MessageContext buildMessageContext(String opName) throws AxisFault { MessageContext msgCtx = new MessageContext(); AxisService svc = getAxisService(); msgCtx.setAxisService(svc); msgCtx.setAxisOperation(getAxisOperation(svc, opName)); return msgCtx; }
public Policy lookup(String identifier) { Policy policy = service.lookupPolicy(identifier); if (policy == null) { try { MessageContext msgContext = new MessageContext(); msgContext.setAxisService(service); DataRetrievalRequest request = new DataRetrievalRequest(); request.putDialect(DRConstants.SPEC.DIALECT_TYPE_POLICY); request.putIdentifier(identifier); Data[] data = service.getData(request, msgContext); if (data.length != 0) { OMElement element = (OMElement) data[0].getData(); if (element != null) { return PolicyEngine.getPolicy(element); } } } catch (DataRetrievalException ex) { logger.error("" + ex); } catch (AxisFault ex) { logger.error("" + ex); } } return policy; }
public Policy lookup(String identifier) { Policy policy = service.lookupPolicy(identifier); if (policy == null) { try { MessageContext msgContext = new MessageContext(); msgContext.setAxisService(service); DataRetrievalRequest request = new DataRetrievalRequest(); request.putDialect(DRConstants.SPEC.DIALECT_TYPE_POLICY); request.putIdentifier(identifier); Data[] data = service.getData(request, msgContext); if (data.length != 0) { OMElement element = (OMElement) data[0].getData(); if (element != null) { return PolicyEngine.getPolicy(element); } } } catch (DataRetrievalException ex) { logger.error("" + ex); } catch (AxisFault ex) { logger.error("" + ex); } } return policy; }
msgContext.setAxisService(axisOperation.getAxisService());
/** * Retrieves the WSDL data associated with the given serviceURL. * @param out The output stream for the WSDL data to be written, NOTE: the stream is not closed after the operation, * it is the responsibility of the caller to close the stream after usage. * @param serviceURL The fist element of this array i.e. serviceURL[0] is taken in retrieving the target service. */ private void getWSDL(OutputStream out, String[] serviceURL) throws AxisFault { // Retrieve WSDL using the same data retrieval path for GetMetadata // request. DataRetrievalRequest request = new DataRetrievalRequest(); request.putDialect(DRConstants.SPEC.DIALECT_TYPE_WSDL); request.putOutputForm(OutputForm.INLINE_FORM); MessageContext context = new MessageContext(); context.setAxisService(this); context.setTo(new EndpointReference(serviceURL[0])); Data[] result = getData(request, context); OMElement wsdlElement; if (result != null && result.length > 0) { wsdlElement = (OMElement) (result[0].getData()); try { XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) { throw AxisFault.makeFault(e); } } }
service = registry.getService("GFacService"); if (service != null) { messageContext.setAxisService(service); if (GFacServiceOperations.INVOKE_SOAP_ACTION.toString().equals(messageContext.getSoapAction())) { messageContext.setAxisOperation(service.getOperation(new QName(GFacServiceOperations.INVOKE
service = registry.getService("GFacService"); if (service != null) { messageContext.setAxisService(service); if (GFacServiceOperations.INVOKE_SOAP_ACTION.toString().equals(messageContext.getSoapAction())) { messageContext.setAxisOperation(service.getOperation(new QName(GFacServiceOperations.INVOKE
/** * Retrieves the WSDL data associated with the given serviceURL. * @param out The output stream for the WSDL data to be written, NOTE: the stream is not closed after the operation, * it is the responsibility of the caller to close the stream after usage. * @param serviceURL The fist element of this array i.e. serviceURL[0] is taken in retrieving the target service. */ private void getWSDL(OutputStream out, String[] serviceURL) throws AxisFault { // Retrieve WSDL using the same data retrieval path for GetMetadata // request. DataRetrievalRequest request = new DataRetrievalRequest(); request.putDialect(DRConstants.SPEC.DIALECT_TYPE_WSDL); request.putOutputForm(OutputForm.INLINE_FORM); MessageContext context = new MessageContext(); context.setAxisService(this); context.setTo(new EndpointReference(serviceURL[0])); Data[] result = getData(request, context); OMElement wsdlElement; if (result != null && result.length > 0) { wsdlElement = (OMElement) (result[0].getData()); try { XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) { throw AxisFault.makeFault(e); } } }
/** * Clone the MessageContext * @param oldMsg * @return * @throws AxisFault */ public static MessageContext cloneMessageContext (MessageContext oldMsg) throws AxisFault { MessageContext newMsg = new MessageContext (); newMsg.setOptions(new Options (oldMsg.getOptions())); // Create a copy of the envelope SOAPEnvelope oldEnvelope = oldMsg.getEnvelope(); if (oldEnvelope != null) { SOAPEnvelope newEnvelope = copySOAPEnvelope(oldMsg.getEnvelope()); newMsg.setEnvelope(newEnvelope); } newMsg.setConfigurationContext(oldMsg.getConfigurationContext()); newMsg.setAxisService(oldMsg.getAxisService()); newMsg.setTransportOut(oldMsg.getTransportOut()); newMsg.setTransportIn(oldMsg.getTransportIn()); //Copy property objects from oldMsg to newMsg copyConfiguredProperties(oldMsg,newMsg); return newMsg; }
/** * @param context */ public void setServiceContext(ServiceContext context) { // allow the service context to be set to null // this allows the message context object to be extraced from // the object graph serviceContext = context; if (serviceContext != null) { if ((operationContext != null) && (operationContext.getParent() != context)) { throw new AxisError("ServiceContext and OperationContext.parent do not match!"); } // setting configcontext using configuration context in service context if (configurationContext == null) { // setting configcontext configurationContext = context.getConfigurationContext(); } if (serviceGroupContext == null) { // setting service group context serviceGroupContext = context.getServiceGroupContext(); } AxisService axisService = context.getAxisService(); this.setAxisService(axisService); // Inform the listeners of an attach event if (axisService != null) { axisService.attachServiceContextEvent(serviceContext, this); } } }
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; } }
/** * @param context */ public void setServiceContext(ServiceContext context) { // allow the service context to be set to null // this allows the message context object to be extraced from // the object graph serviceContext = context; if (serviceContext != null) { if ((operationContext != null) && (operationContext.getParent() != context)) { throw new AxisError("ServiceContext and OperationContext.parent do not match!"); } // setting configcontext using configuration context in service context if (configurationContext == null) { // setting configcontext configurationContext = context.getConfigurationContext(); } if (serviceGroupContext == null) { // setting service group context serviceGroupContext = context.getServiceGroupContext(); } AxisService axisService = context.getAxisService(); this.setAxisService(axisService); // Inform the listeners of an attach event if (axisService != null) { axisService.attachServiceContextEvent(serviceContext, this); } } }
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; } }
msgCtx.setAxisService(service);
messageContext.setAxisService(axisService); AxisOperation axisOperation = axisService.getOperation(new QName(parts[1]));
messageContext.setAxisService(service); AxisOperation operation = service.getOperation(SynapseConstants.SYNAPSE_OPERATION_NAME); messageContext.setAxisOperation(operation);
newMC.getAxisMessage().setParent(mc.getAxisOperation()); newMC.setAxisService(mc.getAxisService());
newMC.getAxisMessage().setParent(mc.getAxisOperation()); newMC.setAxisService(mc.getAxisService());