Package org.springframework.ws.transport.context

Examples of org.springframework.ws.transport.context.TransportContext


     * <p>Defaults to the {@link org.springframework.ws.transport.WebServiceConnection#getUri() connection URI} if no
     * destination was set.
     */
    protected URI getTo() {
        if (to == null) {
            TransportContext transportContext = TransportContextHolder.getTransportContext();
            if (transportContext != null && transportContext.getConnection() != null) {
                try {
                    return transportContext.getConnection().getUri();
                }
                catch (URISyntaxException ex) {
                    // ignore
                }
            }
View Full Code Here


        }
    }

    @Override
    protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
        TransportContext transportContext = TransportContextHolder.getTransportContext();
        if (transportContext != null) {
            WebServiceConnection connection = transportContext.getConnection();
            if (connection != null) {
                URI connectionUri = connection.getUri();
                if (usePath) {
                    return connectionUri.getPath();
                }
View Full Code Here

    @Override
    protected Element invokeInternal(Element arg0) throws Exception
    {
       
        TransportContext context = TransportContextHolder.getTransportContext();
        HttpServletConnection connection = (HttpServletConnection) context
                .getConnection();
        HttpServletRequest request = connection.getHttpServletRequest();
        String ipAddress = request.getRemoteAddr();

        String token = tokenExpression.valueOf(arg0);
View Full Code Here

     * @param receiver   the handler of the message, typically a {@link org.springframework.ws.server.MessageDispatcher}
     */
    protected final void handleConnection(WebServiceConnection connection, WebServiceMessageReceiver receiver)
            throws Exception {
        logUri(connection);
        TransportContext previousTransportContext = TransportContextHolder.getTransportContext();
        TransportContextHolder.setTransportContext(new DefaultTransportContext(connection));

        try {
            WebServiceMessage request = connection.receive(getMessageFactory());
            MessageContext messageContext = new DefaultMessageContext(request, getMessageFactory());
View Full Code Here

    public <T> T sendAndReceive(String uriString,
                                 WebServiceMessageCallback requestCallback,
                                 WebServiceMessageExtractor<T> responseExtractor) {
        Assert.notNull(responseExtractor, "'responseExtractor' must not be null");
        Assert.hasLength(uriString, "'uri' must not be empty");
        TransportContext previousTransportContext = TransportContextHolder.getTransportContext();
        WebServiceConnection connection = null;
        try {
            connection = createConnection(URI.create(uriString));
            TransportContextHolder.setTransportContext(new DefaultTransportContext(connection));
            MessageContext messageContext = new DefaultMessageContext(getMessageFactory());
View Full Code Here

    public void createMocks() throws Exception {
        strategyMock = createMock(MessageIdStrategy.class);

        connectionMock = createMock(WebServiceConnection.class);

        TransportContext transportContext = new DefaultTransportContext(connectionMock);
        TransportContextHolder.setTransportContext(transportContext);
    }
View Full Code Here

        }
        return null;
    }

    private String getUri() throws URISyntaxException {
        TransportContext transportContext = TransportContextHolder.getTransportContext();
        if (transportContext != null) {
            WebServiceConnection webServiceConnection = transportContext.getConnection();
            if (webServiceConnection != null) {
                return webServiceConnection.getUri().toString();
            }
        }
        return null;
View Full Code Here

        }
        return null;
    }

    private String getUri() throws URISyntaxException {
        TransportContext transportContext = TransportContextHolder.getTransportContext();
        if (transportContext != null) {
            WebServiceConnection webServiceConnection = transportContext.getConnection();
            if (webServiceConnection != null) {
                return webServiceConnection.getUri().toString();
            }
        }
        return null;
View Full Code Here

     * Reads information from Http connection and adds them as Http marked headers to internal message representation.
     *
     * @param message
     */
    protected void handleInboundHttpHeaders(SoapMessage message) {
        TransportContext transportContext = TransportContextHolder.getTransportContext();
        if (transportContext == null) {
            log.warn("Unable to get complete set of http request headers - no transport context available");
            return;
        }

        WebServiceConnection connection = transportContext.getConnection();
        if (connection instanceof HttpServletConnection) {
            UrlPathHelper pathHelper = new UrlPathHelper();
            HttpServletConnection servletConnection = (HttpServletConnection) connection;
            message.setHeader(SoapMessageHeaders.HTTP_REQUEST_URI, pathHelper.getRequestUri(servletConnection.getHttpServletRequest()));
            message.setHeader(SoapMessageHeaders.HTTP_CONTEXT_PATH, pathHelper.getContextPath(servletConnection.getHttpServletRequest()));
View Full Code Here

TOP

Related Classes of org.springframework.ws.transport.context.TransportContext

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.