uCosminexus Application Server, Web Service Development Guide
You can use a Web Service on an external network from a Web Service client through a proxy server.
This section describes the property settings required for connecting externally through a proxy server.
To access a Web Service through a proxy server, specify the JavaVM properties or the properties specific to the Cosminexus JAX-WS functionality, and set up the proxy server information. The following table describes the properties and their specified contents, when establishing a connection through a proxy server:
Table 10-14 Properties used for connecting through a proxy server
| No. | Properties | Specified contents | For non-SSL | For SSL |
|---|---|---|---|---|
| 1 | http.proxyHost#1 | Specify the host name or IP address of the proxy server. If a null character is specified, connection is not established with the proxy server. |
Y | -- |
| 2 | http.proxyPort#1 | Specify the port number of the proxy server. If a null character is specified in http.proxyPort when http.proxyHost is set up correctly, the 80th port of the host specified in http.proxyHost is accessed. If http.proxyHost is not specified, connection is not established with the proxy server even if http.proxyPort is specified. |
O | -- |
| 3 | com.cosminexus.jaxws.http.proxyUser#2 | Specify an authentication user ID of the proxy server. If the http.proxyHost property and the http.proxyPort property are specified properly, connect to the proxy server anonymously when a null character is specified in the com.cosminexus.jaxws.http.proxyUser property. |
O | -- |
| 4 | com.cosminexus.jaxws.http.proxyPassword#2 | Specify a password corresponding to the authentication user ID of the proxy server. If the following properties are specified properly, connect to the proxy server without specifying a password, when a null character is specified in the com.cosminexus.jaxws.http.proxyPassword property:
|
O | -- |
| 5 | https.proxyHost#1 | Set up the host name or IP address of the proxy server to be used for connection by SSL protocol#3. To use a proxy server for connection by SSL protocol, make sure that you set up this property. Note that if a null character is specified, connection is not established with the proxy server. |
-- | Y |
| 6 | https.proxyPort#1 | Set up the port number of the proxy server to be used for connection by SSL protocol#3. Note that if a null character is specified in https.proxyPort when https.proxyHost is set up correctly, the 443rd port of the host specified in https.proxyHost is accessed. If https.proxyHost is not specified, connection is not established with the proxy server even if https.proxyPort is specified. |
-- | O |
| 7 | com.cosminexus.jaxws.https.proxyUser#2 | Set an authentication user ID of the proxy server to be used for connecting through the SSL protocol#3. If the https.proxyHost property and the https.proxyPort property are set properly, connect to the proxy server anonymously, when a null character is specified in the com.cosminexus.jaxws.https.proxyUser property. |
-- | O |
| 8 | com.cosminexus.jaxws.https.proxyPassword#2 | Specify a password corresponding to the authentication user ID of the proxy server to be used for connecting through the SSL protocol#3. If the following properties are specified properly, connect to the proxy server without specifying a password, when a null character is specified in the com.cosminexus.jaxws.https.proxyPassword property:
|
-- | O |
| 9 | http.nonProxyHosts#1 | Specify the host names that do not use the proxy server as required. When connecting to the host specified in this property, the proxy server specified in http.proxyHost is not used. To specify multiple hosts, use '|' as a separator. You cannot specify a character other than '|' (such as a space) between two host names. |
O | O |
Set up the properties specific to the Cosminexus JAX-WS functionality in the action definition file. For setting up the action definition files, see the section 10.1 Action definition file. When using the properties specific to the JAX-WS functionality, note the contents described in the subsection 10.10(4) Notes on using properties specific to the JAX-WS functionality.
How to set up the system properties of JavaVM differs depending on the execution of the Web Service client.
The following is an example of property settings:
http.proxyHost=10.209.15.79 http.proxyPort=3128 https.proxyHost=10.209.15.79 https.proxyPort=3128 http.nonProxyHosts=10.209.15.80|www.hitachi.co.jp |
There are no rules for the positions to add property settings.
The properties specific to the JAX-WS functionality are the simple properties. Therefore, for executing the detailed control, we recommend that you perform the implementation using the java.net.Authenticator class of the J2SE 6.0 standard with the Web Service client. For details, see the J2SE 6 documentation. The following is an example of the implementation using the java.net.Authenticator class:
java.net.Authenticator.setDefault( new java.net.Authenticator(){
// Override the getPasswordAuthentication method
public java.net.PasswordAuthentication getPasswordAuthentication() {
// Set the user name
String userName = ...
// Set the password
char[] password = ...
// Generate PasswordAuthentication.
java.net.PasswordAuthentication auth =
new java.net.PasswordAuthentication( userName, password );
return auth;
}
} );
|
With the Cosminexus server, specify the value of the properties specific to the JAX-WS functionality in JavaVM using the setDefault() method of the java.net.Authenticator class of the Java SE standard. Therefore, note the following:
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.