Java Code Examples for com.sun.xml.internal.ws.api.message.Packet#createServerResponse()

The following examples show how to use com.sun.xml.internal.ws.api.message.Packet#createServerResponse() . 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: WSEndpointImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 2
Source File: WSEndpointImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 3
Source File: WSEndpointImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 4
Source File: WSEndpointImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 5
Source File: WSEndpointImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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;
}
 
Example 6
Source File: WSEndpointImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull
PipeHead createPipeHead() {
    return new PipeHead() {
        private final Tube tube = TubeCloner.clone(masterTubeline);

        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);
            }
        }
    };
}
 
Example 7
Source File: ProviderArgumentsBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 8
Source File: ProviderArgumentsBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 9
Source File: WSEndpointImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull
PipeHead createPipeHead() {
    return new PipeHead() {
        private final Tube tube = TubeCloner.clone(masterTubeline);

        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);
            }
        }
    };
}
 
Example 10
Source File: ProviderArgumentsBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 11
Source File: ProviderArgumentsBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source File: ProviderArgumentsBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 13
Source File: ProviderArgumentsBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 14
Source File: WSEndpointImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public @NotNull
PipeHead createPipeHead() {
    return new PipeHead() {
        private final Tube tube = TubeCloner.clone(masterTubeline);

        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);
            }
        }
    };
}
 
Example 15
Source File: ProviderArgumentsBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 16
Source File: ProviderArgumentsBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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;
}
 
Example 17
Source File: ProviderArgumentsBuilder.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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;
}
 
Example 18
Source File: ProviderArgumentsBuilder.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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;
}
 
Example 19
Source File: ProviderArgumentsBuilder.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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;
}
 
Example 20
Source File: ProviderArgumentsBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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;
}