src/share/jaxws_classes/com/sun/xml/internal/ws/developer/JAXWSProperties.java

Thu, 31 Aug 2017 15:18:52 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:18:52 +0800
changeset 637
9c07ef4934dd
parent 368
0989ad8c0860
parent 0
373ffda63c9a
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation. Oracle designates this
aoqi@0 8 * particular file as subject to the "Classpath" exception as provided
aoqi@0 9 * by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 *
aoqi@0 11 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 * accompanied this code).
aoqi@0 16 *
aoqi@0 17 * You should have received a copy of the GNU General Public License version
aoqi@0 18 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 *
aoqi@0 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 * or visit www.oracle.com if you need additional information or have any
aoqi@0 23 * questions.
aoqi@0 24 */
aoqi@0 25
aoqi@0 26 package com.sun.xml.internal.ws.developer;
aoqi@0 27
aoqi@0 28 import com.sun.xml.internal.ws.api.message.HeaderList;
aoqi@0 29 import com.sun.xml.internal.ws.api.server.WSEndpoint;
aoqi@0 30 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
aoqi@0 31
aoqi@0 32 import javax.net.ssl.HostnameVerifier;
aoqi@0 33 import javax.net.ssl.HttpsURLConnection;
aoqi@0 34 import javax.net.ssl.SSLSocketFactory;
aoqi@0 35 import javax.xml.ws.BindingProvider;
aoqi@0 36 import javax.xml.ws.WebServiceContext;
aoqi@0 37 import javax.xml.ws.BindingType;
aoqi@0 38 import javax.xml.ws.http.HTTPBinding;
aoqi@0 39 import java.net.HttpURLConnection;
aoqi@0 40
aoqi@0 41 public interface JAXWSProperties {
aoqi@0 42 // Content negotiation property: values "none", "pessimistic" and "optimistic"
aoqi@0 43 // It is split into two strings so that package renaming for
aoqi@0 44 // Java SE 6 doesn't alter the value. So do not combine them
aoqi@0 45 @Deprecated
aoqi@0 46 public static final String CONTENT_NEGOTIATION_PROPERTY = "com.sun."+"xml.ws.client.ContentNegotiation";
aoqi@0 47 public static final String MTOM_THRESHOLOD_VALUE = "com.sun.xml.internal.ws.common.MtomThresholdValue";
aoqi@0 48 public static final String HTTP_EXCHANGE = "com.sun.xml.internal.ws.http.exchange";
aoqi@0 49
aoqi@0 50 /**
aoqi@0 51 * Set this property on the {@link BindingProvider#getRequestContext()} to
aoqi@0 52 * enable {@link HttpURLConnection#setConnectTimeout(int)}
aoqi@0 53 *
aoqi@0 54 *<p>
aoqi@0 55 * int timeout = ...;
aoqi@0 56 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
aoqi@0 57 * ctxt.put(CONNECT_TIMEOUT, timeout);
aoqi@0 58 */
aoqi@0 59 public static final String CONNECT_TIMEOUT =
aoqi@0 60 "com.sun.xml.internal.ws.connect.timeout";
aoqi@0 61
aoqi@0 62 /**
aoqi@0 63 * Set this property on the {@link BindingProvider#getRequestContext()} to
aoqi@0 64 * enable {@link HttpURLConnection#setReadTimeout(int)}
aoqi@0 65 *
aoqi@0 66 *<p>
aoqi@0 67 * int timeout = ...;
aoqi@0 68 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
aoqi@0 69 * ctxt.put(REQUEST_TIMEOUT, timeout);
aoqi@0 70 */
aoqi@0 71 public static final String REQUEST_TIMEOUT =
aoqi@0 72 "com.sun.xml.internal.ws.request.timeout";
aoqi@0 73
aoqi@0 74 /**
aoqi@0 75 * Set this property on the {@link BindingProvider#getRequestContext()} to
aoqi@0 76 * enable {@link HttpURLConnection#setChunkedStreamingMode(int)}
aoqi@0 77 *
aoqi@0 78 *<p>
aoqi@0 79 * int chunkSize = ...;
aoqi@0 80 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
aoqi@0 81 * ctxt.put(HTTP_CLIENT_STREAMING_CHUNK_SIZE, chunkSize);
aoqi@0 82 */
aoqi@0 83 public static final String HTTP_CLIENT_STREAMING_CHUNK_SIZE = "com.sun.xml.internal.ws.transport.http.client.streaming.chunk.size";
aoqi@0 84
aoqi@0 85
aoqi@0 86 /**
aoqi@0 87 * Set this property on the {@link BindingProvider#getRequestContext()} to
aoqi@0 88 * enable {@link HttpsURLConnection#setHostnameVerifier(HostnameVerifier)}}. The property
aoqi@0 89 * is set as follows:
aoqi@0 90 *
aoqi@0 91 * <p>
aoqi@0 92 * HostNameVerifier hostNameVerifier = ...;
aoqi@0 93 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
aoqi@0 94 * ctxt.put(HOSTNAME_VERIFIER, hostNameVerifier);
aoqi@0 95 *
aoqi@0 96 * <p>
aoqi@0 97 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
aoqi@0 98 */
aoqi@0 99 public static final String HOSTNAME_VERIFIER = "com.sun.xml.internal.ws.transport.https.client.hostname.verifier";
aoqi@0 100
aoqi@0 101 /**
aoqi@0 102 * Set this property on the {@link BindingProvider#getRequestContext()} to
aoqi@0 103 * enable {@link HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory)}. The property is set
aoqi@0 104 * as follows:
aoqi@0 105 *
aoqi@0 106 * <p>
aoqi@0 107 * SSLSocketFactory sslFactory = ...;
aoqi@0 108 * Map<String, Object> ctxt = ((BindingProvider)proxy).getRequestContext();
aoqi@0 109 * ctxt.put(SSL_SOCKET_FACTORY, sslFactory);
aoqi@0 110 *
aoqi@0 111 * <p>
aoqi@0 112 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
aoqi@0 113 */
aoqi@0 114 public static final String SSL_SOCKET_FACTORY = "com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory";
aoqi@0 115
aoqi@0 116 /**
aoqi@0 117 * Acccess the list of SOAP headers in the SOAP message.
aoqi@0 118 *
aoqi@0 119 * <p>
aoqi@0 120 * On {@link WebServiceContext}, this property returns a {@link HeaderList} object
aoqi@0 121 * that represents SOAP headers in the request message that was received.
aoqi@0 122 * On {@link BindingProvider#getResponseContext()}, this property returns a
aoqi@0 123 * {@link HeaderList} object that represents SOAP headers in the response message from the server.
aoqi@0 124 *
aoqi@0 125 * <p>
aoqi@0 126 * The property is read-only, and please do not modify the returned {@link HeaderList}
aoqi@0 127 * as that may break the JAX-WS RI in some unexpected way.
aoqi@0 128 *
aoqi@0 129 * <p>
aoqi@0 130 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
aoqi@0 131 */
aoqi@0 132 public static final String INBOUND_HEADER_LIST_PROPERTY = "com.sun.xml.internal.ws.api.message.HeaderList";
aoqi@0 133
aoqi@0 134 /**
aoqi@0 135 * Access the {@link WSEndpoint} object that delivered the request.
aoqi@0 136 *
aoqi@0 137 * <p>
aoqi@0 138 * {@link WSEndpoint} is the root of the objects that are together
aoqi@0 139 * responsible for delivering requests to the application SEI object.
aoqi@0 140 * One can look up this {@link WSEndpoint} from {@link WebServiceContext},
aoqi@0 141 * and from there access many parts of the JAX-WS RI runtime.
aoqi@0 142 *
aoqi@0 143 * <p>
aoqi@0 144 * <b>THIS PROPERTY IS EXPERIMENTAL AND IS SUBJECT TO CHANGE WITHOUT NOTICE IN FUTURE.</b>
aoqi@0 145 *
aoqi@0 146 * @since 2.1.2
aoqi@0 147 */
aoqi@0 148 public static final String WSENDPOINT = "com.sun.xml.internal.ws.api.server.WSEndpoint";
aoqi@0 149
aoqi@0 150 /**
aoqi@0 151 * Gets the <tt>wsa:To</tt> header.
aoqi@0 152 *
aoqi@0 153 * The propery value is available on incoming SOAP message. The type of the value
aoqi@0 154 * is {@link WSEndpointReference}.
aoqi@0 155 *
aoqi@0 156 * Null if the incoming SOAP message didn't have the header.
aoqi@0 157 *
aoqi@0 158 * @since 2.1.3
aoqi@0 159 */
aoqi@0 160 public static final String ADDRESSING_TO = "com.sun.xml.internal.ws.api.addressing.to";
aoqi@0 161
aoqi@0 162 /**
aoqi@0 163 * Gets the <tt>wsa:From</tt> header.
aoqi@0 164 *
aoqi@0 165 * The propery value is available on incoming SOAP message. The type of the value
aoqi@0 166 * is {@link WSEndpointReference}.
aoqi@0 167 *
aoqi@0 168 * Null if the incoming SOAP message didn't have the header.
aoqi@0 169 *
aoqi@0 170 * @since 2.1.3
aoqi@0 171 */
aoqi@0 172 public static final String ADDRESSING_FROM = "com.sun.xml.internal.ws.api.addressing.from";
aoqi@0 173
aoqi@0 174 /**
aoqi@0 175 * Gets the <tt>wsa:Action</tt> header value.
aoqi@0 176 *
aoqi@0 177 * The propery value is available on incoming SOAP message. The type of the value
aoqi@0 178 * is {@link String}.
aoqi@0 179 *
aoqi@0 180 * Null if the incoming SOAP message didn't have the header.
aoqi@0 181 *
aoqi@0 182 * @since 2.1.3
aoqi@0 183 */
aoqi@0 184 public static final String ADDRESSING_ACTION = "com.sun.xml.internal.ws.api.addressing.action";
aoqi@0 185
aoqi@0 186 /**
aoqi@0 187 * Gets the <tt>wsa:MessageID</tt> header value.
aoqi@0 188 *
aoqi@0 189 * The propery value is available on incoming SOAP message. The type of the value
aoqi@0 190 * is {@link String}.
aoqi@0 191 *
aoqi@0 192 * Null if the incoming SOAP message didn't have the header.
aoqi@0 193 *
aoqi@0 194 * @since 2.1.3
aoqi@0 195 */
aoqi@0 196 public static final String ADDRESSING_MESSAGEID = "com.sun.xml.internal.ws.api.addressing.messageId";
aoqi@0 197
aoqi@0 198 /**
aoqi@0 199 * Reconstructs the URL the client used to make the request. The returned URL
aoqi@0 200 * contains a protocol, server name, port number, and server path, but it does
aoqi@0 201 * not include query string parameters.
aoqi@0 202 * <p>
aoqi@0 203 * The property value is available on incoming SOAP message on servlet transport.
aoqi@0 204 *
aoqi@0 205 * @since 2.1.3
aoqi@0 206 */
aoqi@0 207 public static final String HTTP_REQUEST_URL = "com.sun.xml.internal.ws.transport.http.servlet.requestURL";
aoqi@0 208
aoqi@0 209 /**
aoqi@0 210 * Binding to represent RESTful services. {@link HTTPBinding#HTTP_BINDING} works
aoqi@0 211 * only for Dispatch/Provider services, but this binding works with even SEI based
aoqi@0 212 * services. It would be XML, NOT SOAP on the wire. Hence, the SEI parameters
aoqi@0 213 * shouldn't be mapped to headers.
aoqi@0 214 *
aoqi@0 215 * <p>
aoqi@0 216 * Note that, this only solves limited RESTful usecases.
aoqi@0 217 *
aoqi@0 218 * <p>To enable restful binding on the service, specify the binding id via
aoqi@0 219 * {@link BindingType} or DD
aoqi@0 220 * <pre>
aoqi@0 221 * &#64;WebService
aoqi@0 222 * &#64;BindingType(JAXWSProperties.REST_BINDING)
aoqi@0 223 * </pre>
aoqi@0 224 *
aoqi@0 225 * <p>To enable restful binding on the client side, specify the binding id via
aoqi@0 226 * {@link BindingTypeFeature}
aoqi@0 227 * <pre>
aoqi@0 228 * proxy = echoImplService.getEchoImplPort(new BindingTypeFeature(JAXWSProperties.REST_BINDING));
aoqi@0 229 * </pre>
aoqi@0 230 *
aoqi@0 231 * @since 2.1.4
aoqi@0 232 */
aoqi@0 233 public static final String REST_BINDING = "http://jax-ws.dev.java.net/rest";
aoqi@0 234
aoqi@0 235 }

mercurial