/** * Creates {@link Message} from method invocation's return value */ protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) { Message message = getResponseMessage(e); Packet response = request.createServerResponse(message,port,null,binding); return response; }
/** * Creates {@link Message} from method invocation's return value */ protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) { Message message = getResponseMessage(e); Packet response = request.createServerResponse(message,port,null,binding); return response; }
/** * Creates {@link Message} from method invocation's return value */ protected Packet getResponse(Packet request, Exception e, WSDLPort port, WSBinding binding) { Message message = getResponseMessage(e); Packet response = request.createServerResponse(message,port,null,binding); return response; }
/** * Creates {@link Packet} from method invocation's return value */ protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) { Message message = null; if (returnValue != null) { message = getResponseMessage(returnValue); } Packet response = request.createServerResponse(message,port,null,binding); return response; }
/** * Creates {@link Packet} from method invocation's return value */ protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) { Message message = null; if (returnValue != null) { message = getResponseMessage(returnValue); } Packet response = request.createServerResponse(message,port,null,binding); return response; }
/** * Creates {@link Packet} from method invocation's return value */ protected Packet getResponse(Packet request, @Nullable T returnValue, WSDLPort port, WSBinding binding) { Message message = null; if (returnValue != null) { message = getResponseMessage(returnValue); } Packet response = request.createServerResponse(message,port,null,binding); return response; }
/** * Do MU Header Processing on incoming message (request) * @return * if all the headers in the packet are understood, returns action such that * next pipe will be inovked. * if all the headers in the packet are not understood, returns action such that * SOAPFault Message is sent to previous pipes. */ @Override public NextAction processRequest(Packet request) { Set<QName> misUnderstoodHeaders=null; lock.lock(); try{ misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),roles, handlerKnownHeaders); } finally { lock.unlock(); } if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) { return doInvoke(super.next, request); } return doReturnWith(request.createServerResponse(createMUSOAPFaultMessage(misUnderstoodHeaders), tubeContext.getWsdlModel(), tubeContext.getSEIModel(), tubeContext.getEndpoint().getBinding())); }
/** * Do MU Header Processing on incoming message (request) * @return * if all the headers in the packet are understood, returns action such that * next pipe will be inovked. * if all the headers in the packet are not understood, returns action such that * SOAPFault Message is sent to previous pipes. */ @Override public NextAction processRequest(Packet request) { Set<QName> misUnderstoodHeaders=null; lock.lock(); try{ misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),roles, handlerKnownHeaders); } finally { lock.unlock(); } if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) { return doInvoke(super.next, request); } return doReturnWith(request.createServerResponse(createMUSOAPFaultMessage(misUnderstoodHeaders), tubeContext.getWsdlModel(), tubeContext.getSEIModel(), tubeContext.getEndpoint().getBinding())); }
/** * Do MU Header Processing on incoming message (request) * @return * if all the headers in the packet are understood, returns action such that * next pipe will be inovked. * if all the headers in the packet are not understood, returns action such that * SOAPFault Message is sent to previous pipes. */ @Override public NextAction processRequest(Packet request) { Set<QName> misUnderstoodHeaders=null; lock.lock(); try{ misUnderstoodHeaders = getMisUnderstoodHeaders(request.getMessage().getHeaders(),roles, handlerKnownHeaders); } finally { lock.unlock(); } if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) { return doInvoke(super.next, request); } return doReturnWith(request.createServerResponse(createMUSOAPFaultMessage(misUnderstoodHeaders), tubeContext.getWsdlModel(), tubeContext.getSEIModel(), tubeContext.getEndpoint().getBinding())); }
@Override public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc, final Packet responsePacket, final SOAPVersion soapVersion, final WSDLPort wsdlPort, final SEIModel seiModel, final WSBinding binding) { // This will happen in addressing if it is enabled. if (tc.isFaultCreated()) return responsePacket; final Message faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, tc.getThrowable()); final Packet result = responsePacket.createServerResponse(faultMessage, wsdlPort, seiModel, binding); // Pass info to upper layers tc.setFaultMessage(faultMessage); tc.setResponsePacket(responsePacket); tc.setFaultCreated(true); return result; }
@Override public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc, final Packet responsePacket, final SOAPVersion soapVersion, final WSDLPort wsdlPort, final SEIModel seiModel, final WSBinding binding) { // This will happen in addressing if it is enabled. if (tc.isFaultCreated()) return responsePacket; final Message faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, tc.getThrowable()); final Packet result = responsePacket.createServerResponse(faultMessage, wsdlPort, seiModel, binding); // Pass info to upper layers tc.setFaultMessage(faultMessage); tc.setResponsePacket(responsePacket); tc.setFaultCreated(true); return result; }
@Override public Packet createServiceResponseForException(final ThrowableContainerPropertySet tc, final Packet responsePacket, final SOAPVersion soapVersion, final WSDLPort wsdlPort, final SEIModel seiModel, final WSBinding binding) { // This will happen in addressing if it is enabled. if (tc.isFaultCreated()) return responsePacket; final Message faultMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, tc.getThrowable()); final Packet result = responsePacket.createServerResponse(faultMessage, wsdlPort, seiModel, binding); // Pass info to upper layers tc.setFaultMessage(faultMessage); tc.setResponsePacket(responsePacket); tc.setFaultCreated(true); return result; }
/** * Overwrites the {@link Message} of the response packet ({@code this}) by the given {@link Message}. * Unlike {@link #setMessage(Message)}, fill in the addressing headers correctly, and this process * requires the access to the request packet. * * <p> * This method is useful when the caller needs to swap a response message completely to a new one. * * @see #createServerResponse(Message, AddressingVersion, SOAPVersion, String) */ public void setResponseMessage(@NotNull Packet request, @Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) { Packet temp = request.createServerResponse(responseMessage, addressingVersion, soapVersion, action); setMessage(temp.getMessage()); }
/** * Overwrites the {@link Message} of the response packet ({@code this}) by the given {@link Message}. * Unlike {@link #setMessage(Message)}, fill in the addressing headers correctly, and this process * requires the access to the request packet. * * <p> * This method is useful when the caller needs to swap a response message completely to a new one. * * @see #createServerResponse(Message, AddressingVersion, SOAPVersion, String) */ public void setResponseMessage(@NotNull Packet request, @Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) { Packet temp = request.createServerResponse(responseMessage, addressingVersion, soapVersion, action); setMessage(temp.getMessage()); }
/** * Overwrites the {@link Message} of the response packet ({@code this}) by the given {@link Message}. * Unlike {@link #setMessage(Message)}, fill in the addressing headers correctly, and this process * requires the access to the request packet. * * <p> * This method is useful when the caller needs to swap a response message completely to a new one. * * @see #createServerResponse(Message, AddressingVersion, SOAPVersion, String) */ public void setResponseMessage(@NotNull Packet request, @Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull String action) { Packet temp = request.createServerResponse(responseMessage, addressingVersion, soapVersion, action); setMessage(temp.getMessage()); }
@Override public NextAction processRequest(Packet request) { if (isNoValidation() || !feature.isInbound() || !request.getMessage().hasPayload() || request.getMessage().isFault()) { return super.processRequest(request); } try { doProcess(request); } catch(SAXException se) { LOGGER.log(Level.WARNING, "Client Request doesn't pass Service's Schema Validation", se); // Client request is invalid. So sending specific fault code // Also converting this to fault message so that handlers may get // to see the message. SOAPVersion soapVersion = binding.getSOAPVersion(); Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage( soapVersion, null, se, soapVersion.faultCodeClient); return doReturnWith(request.createServerResponse(faultMsg, wsdlPort, seiModel, binding)); } return super.processRequest(request); }
@Override public NextAction processRequest(Packet request) { if (isNoValidation() || !feature.isInbound() || !request.getMessage().hasPayload() || request.getMessage().isFault()) { return super.processRequest(request); } try { doProcess(request); } catch(SAXException se) { LOGGER.log(Level.WARNING, "Client Request doesn't pass Service's Schema Validation", se); // Client request is invalid. So sending specific fault code // Also converting this to fault message so that handlers may get // to see the message. SOAPVersion soapVersion = binding.getSOAPVersion(); Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage( soapVersion, null, se, soapVersion.faultCodeClient); return doReturnWith(request.createServerResponse(faultMsg, wsdlPort, seiModel, binding)); } return super.processRequest(request); }
@Override public NextAction processRequest(Packet request) { if (isNoValidation() || !feature.isInbound() || !request.getMessage().hasPayload() || request.getMessage().isFault()) { return super.processRequest(request); } try { doProcess(request); } catch(SAXException se) { LOGGER.log(Level.WARNING, "Client Request doesn't pass Service's Schema Validation", se); // Client request is invalid. So sending specific fault code // Also converting this to fault message so that handlers may get // to see the message. SOAPVersion soapVersion = binding.getSOAPVersion(); Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage( soapVersion, null, se, soapVersion.faultCodeClient); return doReturnWith(request.createServerResponse(faultMsg, wsdlPort, seiModel, binding)); } return super.processRequest(request); }
public @NotNull Packet process(Packet request, WebServiceContextDelegate wscd, TransportBackChannel tbc) { Container old = ContainerResolver.getDefault().enterContainer(container); try { request.webServiceContextDelegate = wscd; request.transportBackChannel = tbc; request.endpoint = WSEndpointImpl.this; request.addSatellite(wsdlProperties); Fiber fiber = engine.createFiber(); Packet response; try { response = fiber.runSync(tube, request); } catch (RuntimeException re) { // Catch all runtime exceptions so that transport // doesn't // have to worry about converting to wire message // TODO XML/HTTP binding Message faultMsg = SOAPFaultBuilder .createSOAPFaultMessage(soapVersion, null, re); response = request.createServerResponse(faultMsg, request.endpoint.getPort(), null, request.endpoint.getBinding()); } return response; } finally { ContainerResolver.getDefault().exitContainer(old); } } };
/** * This binds the parameters for SEI endpoints and invokes the endpoint method. The * return value, and response Holder arguments are used to create a new {@link Message} * that traverses through the Pipeline to transport. */ public @NotNull NextAction processRequest(@NotNull Packet req) { JavaCallInfo call = model.getDatabinding().deserializeRequest(req); if (call.getException() == null) { try { if (req.getMessage().isOneWay(model.getPort()) && req.transportBackChannel != null) { req.transportBackChannel.close(); } Object ret = getInvoker(req).invoke(req, call.getMethod(), call.getParameters()); call.setReturnValue(ret); } catch (InvocationTargetException e) { call.setException(e); } catch (Exception e) { call.setException(e); } } else if (call.getException() instanceof DispatchException) { DispatchException e = (DispatchException)call.getException(); return doReturnWith(req.createServerResponse(e.fault, model.getPort(), null, binding)); } Packet res = (Packet) model.getDatabinding().serializeResponse(call); res = req.relateServerResponse(res, req.endpoint.getPort(), model, req.endpoint.getBinding()); assert res != null; return doReturnWith(res); }