aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.xml.internal.ws.developer; aoqi@0: aoqi@0: import com.sun.xml.internal.ws.api.message.HeaderList; aoqi@0: import com.sun.xml.internal.ws.api.server.WSEndpoint; aoqi@0: import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; aoqi@0: aoqi@0: import javax.net.ssl.HostnameVerifier; aoqi@0: import javax.net.ssl.HttpsURLConnection; aoqi@0: import javax.net.ssl.SSLSocketFactory; aoqi@0: import javax.xml.ws.BindingProvider; aoqi@0: import javax.xml.ws.WebServiceContext; aoqi@0: import javax.xml.ws.BindingType; aoqi@0: import javax.xml.ws.http.HTTPBinding; aoqi@0: import java.net.HttpURLConnection; aoqi@0: aoqi@0: public interface JAXWSProperties { aoqi@0: // Content negotiation property: values "none", "pessimistic" and "optimistic" aoqi@0: // It is split into two strings so that package renaming for aoqi@0: // Java SE 6 doesn't alter the value. So do not combine them aoqi@0: @Deprecated aoqi@0: public static final String CONTENT_NEGOTIATION_PROPERTY = "com.sun."+"xml.ws.client.ContentNegotiation"; aoqi@0: public static final String MTOM_THRESHOLOD_VALUE = "com.sun.xml.internal.ws.common.MtomThresholdValue"; aoqi@0: public static final String HTTP_EXCHANGE = "com.sun.xml.internal.ws.http.exchange"; aoqi@0: aoqi@0: /** aoqi@0: * Set this property on the {@link BindingProvider#getRequestContext()} to aoqi@0: * enable {@link HttpURLConnection#setConnectTimeout(int)} aoqi@0: * aoqi@0: *

aoqi@0: * int timeout = ...; aoqi@0: * Map ctxt = ((BindingProvider)proxy).getRequestContext(); aoqi@0: * ctxt.put(CONNECT_TIMEOUT, timeout); aoqi@0: */ aoqi@0: public static final String CONNECT_TIMEOUT = aoqi@0: "com.sun.xml.internal.ws.connect.timeout"; aoqi@0: aoqi@0: /** aoqi@0: * Set this property on the {@link BindingProvider#getRequestContext()} to aoqi@0: * enable {@link HttpURLConnection#setReadTimeout(int)} aoqi@0: * aoqi@0: *

aoqi@0: * int timeout = ...; aoqi@0: * Map ctxt = ((BindingProvider)proxy).getRequestContext(); aoqi@0: * ctxt.put(REQUEST_TIMEOUT, timeout); aoqi@0: */ aoqi@0: public static final String REQUEST_TIMEOUT = aoqi@0: "com.sun.xml.internal.ws.request.timeout"; aoqi@0: aoqi@0: /** aoqi@0: * Set this property on the {@link BindingProvider#getRequestContext()} to aoqi@0: * enable {@link HttpURLConnection#setChunkedStreamingMode(int)} aoqi@0: * aoqi@0: *

aoqi@0: * int chunkSize = ...; aoqi@0: * Map ctxt = ((BindingProvider)proxy).getRequestContext(); aoqi@0: * ctxt.put(HTTP_CLIENT_STREAMING_CHUNK_SIZE, chunkSize); aoqi@0: */ aoqi@0: public static final String HTTP_CLIENT_STREAMING_CHUNK_SIZE = "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size"; aoqi@0: aoqi@0: aoqi@0: /** aoqi@0: * Set this property on the {@link BindingProvider#getRequestContext()} to aoqi@0: * enable {@link HttpsURLConnection#setHostnameVerifier(HostnameVerifier)}}. The property aoqi@0: * is set as follows: aoqi@0: * aoqi@0: *

aoqi@0: * HostNameVerifier hostNameVerifier = ...; aoqi@0: * Map ctxt = ((BindingProvider)proxy).getRequestContext(); aoqi@0: * ctxt.put(HOSTNAME_VERIFIER, hostNameVerifier); aoqi@0: * aoqi@0: *

aoqi@0: * THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE. aoqi@0: */ aoqi@0: public static final String HOSTNAME_VERIFIER = "com.sun.xml.internal.ws.transport.https.client.hostname.verifier"; aoqi@0: aoqi@0: /** aoqi@0: * Set this property on the {@link BindingProvider#getRequestContext()} to aoqi@0: * enable {@link HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory)}. The property is set aoqi@0: * as follows: aoqi@0: * aoqi@0: *

aoqi@0: * SSLSocketFactory sslFactory = ...; aoqi@0: * Map ctxt = ((BindingProvider)proxy).getRequestContext(); aoqi@0: * ctxt.put(SSL_SOCKET_FACTORY, sslFactory); aoqi@0: * aoqi@0: *

aoqi@0: * THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE. aoqi@0: */ aoqi@0: public static final String SSL_SOCKET_FACTORY = "com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory"; aoqi@0: aoqi@0: /** aoqi@0: * Acccess the list of SOAP headers in the SOAP message. aoqi@0: * aoqi@0: *

aoqi@0: * On {@link WebServiceContext}, this property returns a {@link HeaderList} object aoqi@0: * that represents SOAP headers in the request message that was received. aoqi@0: * On {@link BindingProvider#getResponseContext()}, this property returns a aoqi@0: * {@link HeaderList} object that represents SOAP headers in the response message from the server. aoqi@0: * aoqi@0: *

aoqi@0: * The property is read-only, and please do not modify the returned {@link HeaderList} aoqi@0: * as that may break the JAX-WS RI in some unexpected way. aoqi@0: * aoqi@0: *

aoqi@0: * THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE. aoqi@0: */ aoqi@0: public static final String INBOUND_HEADER_LIST_PROPERTY = "com.sun.xml.internal.ws.api.message.HeaderList"; aoqi@0: aoqi@0: /** aoqi@0: * Access the {@link WSEndpoint} object that delivered the request. aoqi@0: * aoqi@0: *

aoqi@0: * {@link WSEndpoint} is the root of the objects that are together aoqi@0: * responsible for delivering requests to the application SEI object. aoqi@0: * One can look up this {@link WSEndpoint} from {@link WebServiceContext}, aoqi@0: * and from there access many parts of the JAX-WS RI runtime. aoqi@0: * aoqi@0: *

aoqi@0: * THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE. aoqi@0: * aoqi@0: * @since 2.1.2 aoqi@0: */ aoqi@0: public static final String WSENDPOINT = "com.sun.xml.internal.ws.api.server.WSEndpoint"; aoqi@0: aoqi@0: /** aoqi@0: * Gets the wsa:To header. aoqi@0: * aoqi@0: * The propery value is available on incoming SOAP message. The type of the value aoqi@0: * is {@link WSEndpointReference}. aoqi@0: * aoqi@0: * Null if the incoming SOAP message didn't have the header. aoqi@0: * aoqi@0: * @since 2.1.3 aoqi@0: */ aoqi@0: public static final String ADDRESSING_TO = "com.sun.xml.internal.ws.api.addressing.to"; aoqi@0: aoqi@0: /** aoqi@0: * Gets the wsa:From header. aoqi@0: * aoqi@0: * The propery value is available on incoming SOAP message. The type of the value aoqi@0: * is {@link WSEndpointReference}. aoqi@0: * aoqi@0: * Null if the incoming SOAP message didn't have the header. aoqi@0: * aoqi@0: * @since 2.1.3 aoqi@0: */ aoqi@0: public static final String ADDRESSING_FROM = "com.sun.xml.internal.ws.api.addressing.from"; aoqi@0: aoqi@0: /** aoqi@0: * Gets the wsa:Action header value. aoqi@0: * aoqi@0: * The propery value is available on incoming SOAP message. The type of the value aoqi@0: * is {@link String}. aoqi@0: * aoqi@0: * Null if the incoming SOAP message didn't have the header. aoqi@0: * aoqi@0: * @since 2.1.3 aoqi@0: */ aoqi@0: public static final String ADDRESSING_ACTION = "com.sun.xml.internal.ws.api.addressing.action"; aoqi@0: aoqi@0: /** aoqi@0: * Gets the wsa:MessageID header value. aoqi@0: * aoqi@0: * The propery value is available on incoming SOAP message. The type of the value aoqi@0: * is {@link String}. aoqi@0: * aoqi@0: * Null if the incoming SOAP message didn't have the header. aoqi@0: * aoqi@0: * @since 2.1.3 aoqi@0: */ aoqi@0: public static final String ADDRESSING_MESSAGEID = "com.sun.xml.internal.ws.api.addressing.messageId"; aoqi@0: aoqi@0: /** aoqi@0: * Reconstructs the URL the client used to make the request. The returned URL aoqi@0: * contains a protocol, server name, port number, and server path, but it does aoqi@0: * not include query string parameters. aoqi@0: *

aoqi@0: * The property value is available on incoming SOAP message on servlet transport. aoqi@0: * aoqi@0: * @since 2.1.3 aoqi@0: */ aoqi@0: public static final String HTTP_REQUEST_URL = "com.sun.xml.internal.ws.transport.http.servlet.requestURL"; aoqi@0: aoqi@0: /** aoqi@0: * Binding to represent RESTful services. {@link HTTPBinding#HTTP_BINDING} works aoqi@0: * only for Dispatch/Provider services, but this binding works with even SEI based aoqi@0: * services. It would be XML, NOT SOAP on the wire. Hence, the SEI parameters aoqi@0: * shouldn't be mapped to headers. aoqi@0: * aoqi@0: *

aoqi@0: * Note that, this only solves limited RESTful usecases. aoqi@0: * aoqi@0: *

To enable restful binding on the service, specify the binding id via aoqi@0: * {@link BindingType} or DD aoqi@0: *

aoqi@0:      * @WebService
aoqi@0:      * @BindingType(JAXWSProperties.REST_BINDING)
aoqi@0:      * 
aoqi@0: * aoqi@0: *

To enable restful binding on the client side, specify the binding id via aoqi@0: * {@link BindingTypeFeature} aoqi@0: *

aoqi@0:      * proxy = echoImplService.getEchoImplPort(new BindingTypeFeature(JAXWSProperties.REST_BINDING));
aoqi@0:      * 
aoqi@0: * aoqi@0: * @since 2.1.4 aoqi@0: */ aoqi@0: public static final String REST_BINDING = "http://jax-ws.dev.java.net/rest"; aoqi@0: aoqi@0: }