com.sun.xml.internal.ws.api.pipe.NextAction Java Examples

The following examples show how to use com.sun.xml.internal.ws.api.pipe.NextAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClientMUTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Do MU Header Processing on incoming message (response)
 *
 * @return
 *         if all the headers in the packet are understood, returns an action to
 *         call the previous pipes with response packet
 * @throws SOAPFaultException
 *         if all the headers in the packet are not understood, throws SOAPFaultException
 */
@Override @NotNull
public NextAction processResponse(Packet response) {
    if (response.getMessage() == null) {
        return super.processResponse(response);
    }
    HandlerConfiguration handlerConfig = response.handlerConfig;

    if (handlerConfig == null) {
        //Use from binding instead of defaults in case response packet does not have it,
        //may have been changed from the time of invocation, it ok as its only fallback case.
        handlerConfig = binding.getHandlerConfig();
    }
    Set<QName> misUnderstoodHeaders = getMisUnderstoodHeaders(response.getMessage().getHeaders(), handlerConfig.getRoles(),binding.getKnownHeaders());
    if((misUnderstoodHeaders == null) || misUnderstoodHeaders.isEmpty()) {
        return super.processResponse(response);
    }
    throw createMUSOAPFaultException(misUnderstoodHeaders);
}
 
Example #2
Source File: SEIInvokerTube.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: SEIInvokerTube.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #4
Source File: SEIInvokerTube.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #5
Source File: ServerSchemaValidationTube.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #6
Source File: ServerSchemaValidationTube.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #7
Source File: ServerSchemaValidationTube.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@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);
}
 
Example #8
Source File: ClientSchemaValidationTube.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processRequest(Packet request) {
    if (isNoValidation() || !feature.isOutbound() || !request.getMessage().hasPayload() || request.getMessage().isFault()) {
        return super.processRequest(request);
    }
    try {
        doProcess(request);
    } catch(SAXException se) {
        throw new WebServiceException(se);
    }
    return super.processRequest(request);
}
 
Example #9
Source File: ClientSchemaValidationTube.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processResponse(Packet response) {
    if (isNoValidation() || !feature.isInbound() || response.getMessage() == null || !response.getMessage().hasPayload() || response.getMessage().isFault()) {
        return super.processResponse(response);
    }
    try {
        doProcess(response);
    } catch(SAXException se) {
        throw new WebServiceException(se);
    }
    return super.processResponse(response);
}
 
Example #10
Source File: ServerSchemaValidationTube.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processResponse(Packet response) {
    if (isNoValidation() || !feature.isOutbound() || response.getMessage() == null || !response.getMessage().hasPayload() || response.getMessage().isFault()) {
        return super.processResponse(response);
    }
    try {
        doProcess(response);
    } catch(SAXException se) {
        // TODO: Should we convert this to fault Message ??
        throw new WebServiceException(se);
    }
    return super.processResponse(response);
}
 
Example #11
Source File: AsyncProviderInvokerTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull NextAction processRequest(@NotNull Packet request) {
    T param = argsBuilder.getParameter(request);
    NoSuspendResumer resumer = new NoSuspendResumer();
    @SuppressWarnings({ "rawtypes", "unchecked" })
            AsyncProviderCallbackImpl callback = new AsyncProviderInvokerTube.AsyncProviderCallbackImpl(request, resumer);
    AsyncWebServiceContext ctxt = new AsyncWebServiceContext(getEndpoint(),request);

    AsyncProviderInvokerTube.LOGGER.fine("Invoking AsyncProvider Endpoint");
    try {
        getInvoker(request).invokeAsyncProvider(request, param, callback, ctxt);
    } catch(Throwable e) {
        LOGGER.log(Level.SEVERE, e.getMessage(), e);
        return doThrow(e);
    }

    synchronized(callback) {
            if (resumer.response != null) {
            // Only used by AsyncProvider<Packet>
            // Implementation may pass Packet containing throwable; use both
                ThrowableContainerPropertySet tc = resumer.response.getSatellite(ThrowableContainerPropertySet.class);
                Throwable t = (tc != null) ? tc.getThrowable() : null;

                    return t != null ? doThrow(resumer.response, t) : doReturnWith(resumer.response);
            }

            // Suspend the Fiber. AsyncProviderCallback will resume the Fiber after
            // it receives response.
            callback.resumer = new FiberResumer();
            return doSuspend();
    }
}
 
Example #12
Source File: WsaClientTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public @NotNull NextAction processResponse(Packet response) {
    // if one-way then, no validation
    if (response.getMessage() != null) {
        response = validateInboundHeaders(response);
        response.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,response));
        String msgId = AddressingUtils.
          getMessageID(response.getMessage().getHeaders(),
                  addressingVersion, soapVersion);
        response.put(WsaPropertyBag.WSA_MSGID_FROM_REQUEST, msgId);
    }

    return doReturnWith(response);
}
 
Example #13
Source File: LoggingDumpTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processRequest(Packet request) {
    if (messageDumper.isLoggable()) {
        Packet dumpPacket = (request != null) ? request.copy(true) : null;
        messageDumper.dump(MessageDumper.MessageType.Request, position.requestState, Converter.toString(dumpPacket), tubeId, Fiber.current().owner.id);
    }

    return super.processRequest(request);
}
 
Example #14
Source File: WsaClientTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public @NotNull NextAction processResponse(Packet response) {
    // if one-way then, no validation
    if (response.getMessage() != null) {
        response = validateInboundHeaders(response);
        response.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,response));
        String msgId = AddressingUtils.
          getMessageID(response.getMessage().getHeaders(),
                  addressingVersion, soapVersion);
        response.put(WsaPropertyBag.WSA_MSGID_FROM_REQUEST, msgId);
    }

    return doReturnWith(response);
}
 
Example #15
Source File: WsaClientTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public @NotNull NextAction processResponse(Packet response) {
    // if one-way then, no validation
    if (response.getMessage() != null) {
        response = validateInboundHeaders(response);
        response.addSatellite(new WsaPropertyBag(addressingVersion,soapVersion,response));
        String msgId = AddressingUtils.
          getMessageID(response.getMessage().getHeaders(),
                  addressingVersion, soapVersion);
        response.put(WsaPropertyBag.WSA_MSGID_FROM_REQUEST, msgId);
    }

    return doReturnWith(response);
}
 
Example #16
Source File: LoggingDumpTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processRequest(Packet request) {
    if (messageDumper.isLoggable()) {
        Packet dumpPacket = (request != null) ? request.copy(true) : null;
        messageDumper.dump(MessageDumper.MessageType.Request, position.requestState, Converter.toString(dumpPacket), tubeId, Fiber.current().owner.id);
    }

    return super.processRequest(request);
}
 
Example #17
Source File: LoggingDumpTube.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processResponse(Packet response) {
    if (messageDumper.isLoggable()) {
        Packet dumpPacket = (response != null) ? response.copy(true) : null;
        messageDumper.dump(MessageDumper.MessageType.Response, position.responseState, Converter.toString(dumpPacket), tubeId, Fiber.current().owner.id);
    }

    return super.processResponse(response);
}
 
Example #18
Source File: ClientSchemaValidationTube.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processResponse(Packet response) {
    if (isNoValidation() || !feature.isInbound() || response.getMessage() == null || !response.getMessage().hasPayload() || response.getMessage().isFault()) {
        return super.processResponse(response);
    }
    try {
        doProcess(response);
    } catch(SAXException se) {
        throw new WebServiceException(se);
    }
    return super.processResponse(response);
}
 
Example #19
Source File: ClientSchemaValidationTube.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processRequest(Packet request) {
    if (isNoValidation() || !feature.isOutbound() || !request.getMessage().hasPayload() || request.getMessage().isFault()) {
        return super.processRequest(request);
    }
    try {
        doProcess(request);
    } catch(SAXException se) {
        throw new WebServiceException(se);
    }
    return super.processRequest(request);
}
 
Example #20
Source File: LoggingDumpTube.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public NextAction processException(Throwable t) {
    if (messageDumper.isLoggable()) {
        messageDumper.dump(MessageDumper.MessageType.Exception, position.responseState, Converter.toString(t), tubeId, Fiber.current().owner.id);
    }

    return super.processException(t);
}
 
Example #21
Source File: AbstractTubeImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Deprecated
protected final NextAction doSuspend() {
    NextAction na = new NextAction();
    na.suspend();
    return na;
}
 
Example #22
Source File: DumpTube.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public NextAction processResponse(Packet response) {
    dump("response",response);
    return super.processResponse(response);
}
 
Example #23
Source File: WsaTube.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public @NotNull NextAction processException(Throwable t) {
    return super.processException(t);
}
 
Example #24
Source File: AbstractTubeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected final NextAction doSuspend(Tube next, Runnable onExitRunnable) {
    NextAction na = new NextAction();
    na.suspend(next, onExitRunnable);
    return na;
}
 
Example #25
Source File: SyncProviderInvokerTube.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public @NotNull NextAction processException(@NotNull Throwable t) {
    return doThrow(t);
}
 
Example #26
Source File: SEIInvokerTube.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public @NotNull NextAction processResponse(@NotNull Packet response) {
    return doReturnWith(response);
}
 
Example #27
Source File: AbstractTubeImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected final NextAction doThrow(Throwable t) {
    NextAction na = new NextAction();
    na.throwException(t);
    return na;
}
 
Example #28
Source File: AbstractTubeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected final NextAction doThrow(Throwable t) {
    NextAction na = new NextAction();
    na.throwException(t);
    return na;
}
 
Example #29
Source File: AbstractTubeImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected final NextAction doThrow(Throwable t) {
    NextAction na = new NextAction();
    na.throwException(t);
    return na;
}
 
Example #30
Source File: SEIInvokerTube.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public @NotNull NextAction processException(@NotNull Throwable t) {
    return doThrow(t);
}