Package com.sun.xml.internal.ws.api.message

Examples of com.sun.xml.internal.ws.api.message.Packet


     * @param codec for encoding/decoding {@link Message}
     * @return decoded {@link Packet}
     * @throws IOException if an i/o error happens while encoding/decoding
     */
    protected Packet decodePacket(T connection, @NotNull Codec codec) throws IOException {
        Packet packet = new Packet();
        packet.acceptableMimeTypes = getAcceptableMimeTypes(connection);
        packet.addSatellite(getPropertySet(connection));
        packet.transportBackChannel = getTransportBackChannel(connection);
        return packet;
    }
View Full Code Here


     * @param connection that carries the web service request
     * @throws IOException if an i/o error happens while encoding/decoding
     */
    protected void handle(final T connection) throws IOException {
        final Codec codec = codecPool.take();
        Packet request = decodePacket(connection, codec);
        if (!request.getMessage().isFault()) {
            endpoint.schedule(request, new WSEndpoint.CompletionCallback() {
                public void onCompletion(@NotNull Packet response) {
                    try {
                        encodePacket(connection, response, codec);
                    } catch(IOException ioe) {
View Full Code Here

        return response.getMessage();
    }

    @Override
    Packet createPacket(Message msg) {
        return new Packet(msg);
    }
View Full Code Here

            // when the call fails with an exception it's no longer a 'reply' but it may provide some information
            // about what went wrong.

            // note that Packet can still be updated after
            // ResponseContext is created.
            Packet reply = (fiber.getPacket() == null) ? packet : fiber.getPacket();
            receiver.setResponseContext(new ResponseContext(reply));

            pool.recycle(tube);
        }
    }
View Full Code Here

     *
     * See {@link #process(Packet, RequestContext, ResponseContextReceiver)} on
     * why it takes a {@link RequestContext} and {@link ResponseContextReceiver} as a parameter.
     */
    public final T doInvoke(T in, RequestContext rc, ResponseContextReceiver receiver){
        Packet response;
        try {
            checkNullAllowed(in, rc, binding, mode);

            Packet message = createPacket(in);
            resolveEndpointAddress(message, rc);
            setProperties(message,true);
            response = process(message,rc,receiver);
            Message msg = response.getMessage();

View Full Code Here

    public final void invokeOneWay(T in) {
        try {
            checkNullAllowed(in, requestContext, binding, mode);

            Packet request = createPacket(in);
            setProperties(request,false);
            Packet response = process(request,requestContext,this);
        } catch(WebServiceException e){
            //it could be a WebServiceException or a ProtocolException
            throw e;
        } catch(Throwable e){
            // it could be a RuntimeException resulting due to some internal bug or
View Full Code Here

     *      This {@link RequestContext} is used for invoking this method.
     *      We take this as a separate parameter because of the async invocation
     *      handling, which requires a separate copy.
     */
    Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable {
        Packet req = new Packet(createRequestMessage(args));

        req.soapAction = soapAction;
        req.expectReply = !isOneWay;
        req.getMessage().assertOneWay(isOneWay);

        // process the message
        Packet reply = owner.doProcess(req,rc,receiver);

        Message msg = reply.getMessage();
        if(msg ==null)
            // no reply. must have been one-way
            return null;

        try {
View Full Code Here

    final class HttpToolkit extends Adapter.Toolkit {
        public void handle(WSHTTPConnection con) throws IOException {
            boolean invoke = false;
            try {
                Packet packet = new Packet();
                try {
                    packet = decodePacket(con, codec);
                    invoke = true;
                } catch(ExceptionHasMessage e) {
                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
                    packet.setMessage(e.getFaultMessage());
                } catch(UnsupportedMediaException e) {
                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
                    con.setStatus(WSHTTPConnection.UNSUPPORTED_MEDIA);
                } catch(Exception e) {
                    LOGGER.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

            if (param == null) {
                if (request.transportBackChannel != null) {
                    request.transportBackChannel.close();
                }
            }
            Packet packet = argsBuilder.getResponse(request, param, getEndpoint().getPort(), getEndpoint().getBinding());
            fiber.resume(packet);
        }
View Full Code Here

            if (t instanceof RuntimeException) {
                e = (RuntimeException)t;
            } else {
                e = new RuntimeException(t);
            }
            Packet packet = argsBuilder.getResponse(request, e, getEndpoint().getPort(), getEndpoint().getBinding());
            fiber.resume(packet);
        }
View Full Code Here

TOP

Related Classes of com.sun.xml.internal.ws.api.message.Packet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.