@Override public void invokeBusinessLogic(MessageContext inMC) throws AxisFault { try { OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement(); provider.invoke(requestOM, inMC, null); } catch (InvocationTargetException e) { Throwable t = e.getCause(); if (t instanceof Exception) { throw AxisFault.makeFault((Exception)t); } throw new RuntimeException(e); } catch (Exception e) { e.printStackTrace(); throw AxisFault.makeFault(e); } } }
if (header != null) { callbackAddress = handleCallbackAddress( header, msg ); handleMessageIDHeader( header, msg ); handleRelatesToHeader( header, msg ); createCallbackEPR( callbackAddress, inMC, msg ); setupAsyncResponse( msg, callbackAddress );
public static void createAxisServiceProviders(AxisService axisService, RuntimeEndpoint endpoint, WebServiceBinding wsBinding, ExtensionPointRegistry extensionPoints) { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation)i.next(); Operation op = getOperation(axisOp, wsBinding); if (op != null) { if (op.isNonBlocking()) { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY); } else { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT); } MessageReceiver msgrec = null; TuscanyServiceProvider serviceProvider = new TuscanyServiceProvider(extensionPoints, endpoint, wsBinding, op); if (op.isNonBlocking()) { msgrec = new Axis2ServiceInMessageReceiver(serviceProvider); } else { msgrec = new Axis2ServiceInOutSyncMessageReceiver(serviceProvider); } axisOp.setMessageReceiver(msgrec); } } }
/** * If there is a callback address, create an EPR for the callback with a referenced endpoint that contains * the binding and the target callback address * @param callbackAddress - the callback address - may be null * @param inMC - the Axis incoming message context * @param msg - the Tuscany message * @throws AxisFault - if the callback address has any of the disallowed forms of callback address */ private void createCallbackEPR( String callbackAddress, MessageContext inMC, Message msg ) throws AxisFault { if (callbackAddress != null ) { // Check for special (& not allowed!) WS_Addressing values checkCallbackAddress( callbackAddress, inMC ); // EndpointReference from = assemblyFactory.createEndpointReference(); Endpoint fromEndpoint = assemblyFactory.createEndpoint(); from.setTargetEndpoint(fromEndpoint); from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED); msg.setFrom(from); RuntimeEndpoint callbackEndpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint(); // WebServiceBinding cbBinding = webServiceBindingFactory.createWebServiceBinding(); cbBinding.setURI(callbackAddress); callbackEndpoint.setBinding(cbBinding); // callbackEndpoint.setURI(callbackAddress); callbackEndpoint.setUnresolved(true); from.setCallbackEndpoint(callbackEndpoint); } // end if } // end method createCallbackEPR
outMC.setEnvelope(soapEnvelope); provider.invoke(requestOM, inMC, outMC);