Version 9.5 SP1
 —  Configuration  —

Transports

Web Services Stack supports sending and receiving of messages over the following transports:

By default, the HTTP transport is activated in all three Web Services Stack distributions (Web Services Stack in standalone server, Web Services Stack in web application, and Web Services Stack in Software AG Runtime). The HTTPS transport is activated by default only in the Web Services Stack in web application distribution, and needs to be explicitly enabled in the other installations. When you deploy a Web service archive file on the Web Services Stack runtime that runs on the Software AG Runtime server, service endpoints for all enabled transports are created automatically.

The following instructions show how to configure and activate or deactivate the other transports supported by Web Services Stack.

The information is organized under the following headings:


HTTP/HTTPS Transport

By default, the HTTP transport is activated in all three Web Services Stack distributions (Web Services Stack in standalone server, Web Services Stack in web application, and Web Services Stack in Software AG Runtime). The HTTPS transport is activated only in the Web Services Stack in web application distribution, and needs to be explicitly enabled in the other installations. The following procedure outlines the steps you must perform to enable or disable the HTTP and HTTPS transports.

Note:
If you disable a connector in Software AG Tomcat Server, make sure that the respective transport sender and receiver are disabled on the Web Services Stack side as well (axis2.xml). If a transport is enabled in the axis2.xml file and the respective connector in the server.xml file is disabled, an error occurs on the Web Services Stack side.

Note:
Make sure at least one of your HTTPS connectors has the description property set to "Default HTTPS Connector". This value exists by default in the predefined HTTPS connector definition. The "Default HTTPS Connector" value is used by the Common Platform to distinguish default connectors from other existing connectors. If this value is not present in at least one HTTPS connector definition, this results in an invalid or corrupted Software AG Runtime configuration the next time you install or upgrade a product in the profile.

Activating or Deactivating HTTP or HTTPS Transport

The information in this topic is organized under the following headings:

Activating or Deactivating HTTP or HTTPS in Web Services Stack

If you want to activate or deactivate HTTP or HTTPS in Web Services Stack, follow these steps:

Start of instruction setTo activate or deactivate HTTP or HTTPS in Web Services Stack

  1. Go to the web application server where the Web Services Stack runtime is installed.

  2. Open the axis2.xml configuration file in the webapps/wsstack/WEB-INF/conf directory for the Web Service Stack web application.

    Note:
    For Web Services Stack that uses Software AG Runtime Server the axis2.xml file is in the following directory: <Software AG_directory>/profiles/CTP/workspace/wsstack/repository/conf/.

  3. Comment out the sections that define the transport receiver and transport sender with name="http" or name="https":

    <transportReceiver name="http" ... />
    <transportSender name="http" ... />
    <transportReceiver name="https" ... />
    <transportSender name="https" ... />
  4. Restart the Web Services Stack runtime for the modifications to take effect.

    For Web Services Stack that uses Software AG Runtime Server, restart the "Software AG Runtime" Windows Service (using the Control Panel > Administrative Tools > Services).

Activating or Deactivating HTTP or HTTPS in Software AG Runtime Server

If you want to activate or deactivate HTTP or HTTPS in Software AG Runtime server, follow these steps:

Start of instruction setTo activate or deactivate HTTP or HTTPS in Software AG Runtime server

  1. Open the server.xml configuration file under the <Software AG_directory>/profiles/CTP/configuration/tomcat/conf/ directory.

  2. Comment out the sections that define the HTTP and HTTPS connectors, for example:

    <clientAuth="false"
    sslProtocol="TLS"
    SSLEnabled="true"
    keystoreFile="C:/SoftwareAG/profiles/CTP/configuration/tomcat/conf/localhost_dont_use_in_production.jks"
    enabled="true"
    port="10011"
    keystorePass="change_this_password"
    scheme="https"
    enableLookups="false"
    secure="true"
    alias="defaultHttps"
    maxSpareThreads="75"
    maxThreads="150"
    server="SoftwareAG-Runtime"
    keystoreType="JKS"
    disableUploadTimeout="true"
    description="Default HTTPS Connector"
    algorithm="SunX509"
    minSpareThreads="25"
    acceptCount="100"
    maxHttpHeaderSize="8192"/>
  3. Restart Software AG Runtime Server by restarting the "Software AG Runtime" Windows Service (using the Control Panel > Administrative Tools > Services).

Top of page

TCP Transport

There are no prerequisites for the activation of TCP transport.

Activating TCP Transport (Server-side Configuration)

Start of instruction setTo activate TCP transport in Web Services Stack

  1. Go to the web application server where the Web Services Stack runtime is installed.

  2. Open the axis2.xml configuration file under the webapps/wsstack/WEB-INF/conf directory for the Web Service Stack web application.

    Note:
    For Web Services Stack that uses Platform Tomcat Server the axis2.xml file is in the following directory: <Software AG_directory>/profiles/CTP/workspace/wsstack/repository/conf/.

  3. Uncomment the sections that define the transport receiver and transport sender with name="tcp":

    <transportReceiver name="tcp" ... />
    <transportSender name="tcp" ... />

    The only parameter required for the transport receiver is its port number. The suggested default value is 6060.

Note:
Restart the Web Services Stack runtime for the modifications to take effect.

Enabling WS-Addressing

Since the TCP transport has no application level headers (and no target endpoint URI), you need WS-Addressing to dispatch the service.

Note:
WS-Addressing may not be enabled in the default Web Services Stack installation.

Start of instruction setTo enable WS-Addressing

Forcing Deployment Over TCP Transport Only

If not explicitly configured, a web service is deployed over all activated transports in the Web Services Stack runtime. In this case, the web service is accessible at all enabled endpoints.

You may, however, want to restrict a web service to be accessible only over TCP transport.

Start of instruction setTo deploy over TCP transport only

Note:
Since TCP transport has no application level headers, and thus no target endpoint URI, you need WS-Addressing to dispatch the service. If WS-Addressing is not globally enabled, you have to enable it for the service.

Invoking a Web Service Over TCP Transport (Client-side Configuration)

To make a call to a web service over TCP transport, configure the client’s repository.

Start of instruction setTo invoke a web service over TCP

  1. Uncomment the sections that define the transport receiver and transport sender with name=“tcp” in the client’s axis2.xml configuration file:

    <transportReceiver name="tcp" ... />
    <transportSender name="tcp" ... />
  2. Engage globally the WS-Addressing module (addressing.mar) in the client’s axis2.xml file:

    <module ref="addressing"/>
  3. Ensure the WS-Addressing module (addressing.mar) is present in the /modules directory in the client’s repository.

Top of page

JMS Transport in Web Services Stack Web Application

Prerequisites

Following are guidelines to the prerequisites for the activation of JMS transport.

Installing and Starting a Message Broker

If you want to install and start a message broker, do the following:

Start of instruction setTo install and start a message broker

In order to achieve JMS communication, you need a message broker that handles the distribution of messages between communicating parties. Web Services Stack does not include a built-in message broker. This requires the use of an external one. Apache ActiveMQ is an open source message broker that you can download from http://activemq.apache.org/activemq-411-release.html.

After the installation, ActiveMQ is running with a basic configuration that is sufficient for its integration with the Web Services Stack.

Note:
If you want to terminate the broker, type the CTRL-C command in the comand prompt in which it is running.

Running the ActiveMQ Message Broker

If you want to run the Active MQ Message Broker, follow these steps:

Start of instruction setTo run the ActiveMQ message broker

  1. Open the command prompt

  2. Navigate to the ACTIVEMQ_HOME/bin directory

  3. Run the activemq.bat file.

You can find more about installing and using Apache ActiveMQ open source message broker at http://activemq.apache.org/getting-started.html.

Providing Additional Libraries for the WSS Runtime

If you want to provide additional libraries for the Web Services Stack runtime, follow these steps:

Start of instruction setTo provide additional libraries for the Web Services Stack runtime

Configuring Web Services Stack to work with Apache ActiveMQ message broker requires the provision of additional libraries for the Web Services Stack runtime.

  1. Go to the ACTIVEMQ_HOME/lib directory.

  2. Copy the following libraries to the <web_app_server>/webapps/wsstack/WEB-INF/lib directory of the Web Services Stack runtime in the web application server:

Activating JMS Transport (Server-Side Configuration)

Start of instruction setTo activate JMS transport in Web Services Stack

  1. Go to the web application server, where the Web Services Stack runtime is installed

  2. Open the axis2.xml configuration file under the webapps/wsstack/WEB-INF/conf directory for the Web Service Stack web application.

    Note:
    For Web Services Stack that uses Platform Tomcat Server the axis2.xml file is in the following directory: <Software AG_directory>/profiles/CTP/workspace/wsstack/repository/conf/.

  3. Uncomment the sections that define the transport receiver and transport sender with name="jms":

    <transportReceiver name="jms" ... />
    	<transportSender name="jms" ... />
    
  4. Define the custom connection factories

    You can define custom connection factories as parameters under JMS transport receiver. They can be used by the services deployed over JMS transport. Refer to the axis2.xml configuration file to see the sample connection factories that the JMS transport receiver configuration includes.

    Note:
    One of the connection factories is named as default for use by services that do not explicitly specify in their services.xml configuration file the connection factory they want to use.

    Those connection factories are associated with Apache ActiveMQ implementation whose libraries are required for the Web Services Stack runtime. Each connection factory specifies the following parameters:

    Web Services Stack can run with the default configuration of Apache ActiveMQ. In this case, you only have to uncomment the JMS transport receiver and JMS transport sender configuration in the axis2.xml file.

    Note:
    You must always run the message broker before you start Web Services Stack.

Forcing Deployment Over JMS Transport Only

If not explicitly configured, a web service is deployed over all activated transports in the Web Services Stack runtime. However, you can restrict a web service to be deployed over JMS transport only.

Note:
You can also specify the destination where the service listens for messages, as well as the name of the connection factory to be used. The service can use one of the connection factories defined within the JMS transport receiver in the axis2.xml configuration file.

Deploying over JMS Transport Only

If you want to deploy over JMS transport only, follow this step:

Start of instruction setTo deploy over JMS transport only

Specifying the Connection Factory Name

You can specify a name for the connection factory that the Web service will use. This can be done by modifying directly the services.xml file, or by using the WSS Designer plug-in. The parameters that define the connection factory name are optional. If they are not specified, the service uses the default connection factory (named as default in the configuration of the JMS transport receiver in the axis2.xml file) and listens for messages on a JMS queue by the same name as the name of the service.

You can specify the connection factory name through the services.xml file by adding the elements in bold. The connection factory can be any of the connection factories defined in axis2.xml and the destination name can be anything. "transport.jms.ConnectionFactory" and "myQueueConnectionFactory" are samples for values of parameters.

<service ...>
		<transports>
			<transport>jms</transport>
		</transports>
		<parameter name="transport.jms.ConnectionFactory" locked="true">myQueueConnectionFactory</parameter>
		<parameter name="transport.jms.Destination" locked="true">dynamicQueues/TestQueue</parameter>
		...
	</service>

You can also use the WSS Designer plug-in to specify the connection factory name.

Start of instruction setTo specify the connection factory name using the WSS Designer plug-in

  1. In the Project Explorer view, select the Web service archive that will use the connection factory.

  2. Click the Services tab.

  3. To specify the connection factory, in the Properties section:

    1. Click Add.

    2. Type "transport.jms.ConnectionFactory" in the Name field.

    3. Type "myQueueConnectionFactory" (or another connection factory defined in axis2.xml) in the Value field.

    4. Click OK.

  4. To add the destinations:

    1. Click Add .

    2. Type "transport.jms.Destination" in the Name field.

    3. Type "dynamicQueues/TestQueue" (or other value of your choice) in the Value field.

    4. Click OK.

The connection factory name is now set and visible in the Services.xml tab.

For more information about working with the Web Services Stack Designer plug-in, see Software AG Designer Plug-in.

Invoking a Web Service Over JMS Transport (Client-side Configuration)

To make a call to a web service over JMS transport, you have to configure the client’s repository.

Start of instruction setTo invoke a web service over JMS

  1. Uncomment the sections that define the transport receiver and transport sender with name=“jms” in the client’s axis2.xml configuration file:

    <transportReceiver name="jms" ... />
    <transportSender name="jms" ... />
  2. Engage globally the WS-Addressing module (addressing.mar) in the client’s axis2.xml file.

    <module ref="addressing"/>
  3. Ensure the WS-Addressing module (addressing.mar) is present in the /modules directory in the client’s repositor.

Top of page

Mail Transport in Web Services Stack Web Application

The information is organized under the following headings:

Prerequisites

To activate mail transport in Web Services Stack, you need the following prerequisites:

Install, Configure and Start a Mail Server

The activation of mail transport in Web Services Stack requires a mail server that transfers e-mail messages. The Apache Java Enterprise Mail Server (James) is an open source SMTP and POP3 mail server that is used by Web Services Stack.

Installing Apache James Server

If you want to install the Apache James Server, follow these steps:

Start of instruction setTo install Apache James server

  1. Download the archive with the binary distribution of the Apache James mail server from http://james.apache.org/download.cgi.

  2. Extract the files from the downloaded archive to a JAMES_HOME directory of your choice.

  3. Start and stop the mail server once so that it unpacks its configuration files.

Opening the Configuration Files for Editing

If you want to open the configuration files for editing, follow these steps:

Start of instruction setTo open the configuration files for editing

  1. Open the command prompt.

  2. Navigate to JAMES_HOME/bin directory.

  3. Run run.bat to start the server.

  4. Use the CTRL+C command to stop the mail server.

  5. Type the ipconfig/all command to check your network configuration.

    Note:
    You need this information for the next instruction (configuring the DNS servers).

Configuring the DNS Servers in the Mail Server

If you want to configure the DNS servers in the mail server, follow these steps:

Start of instruction setTo configure the DNS servers in the mail server

  1. Open the config.xml file under the JAMES_HOME/apps/james/SAR-INF directory

  2. Find the tag <dnsserver> and enter the IP address of each DNS server from your network configuration as shown in the following example:

    <dnsserver>
    		<servers>
    			<server>[DNS.Server.IP.address]</server>
    				<server>...</server>
    		</servers>
    		...
    </dnsserver>
    

    Note:
    Apache James mail server requires the valid IP addresses of the DNS servers in your network configuration.

  3. Start the mail server again.

You can read more about the configuration of Apache James mail server in the "Configuring James" section of the James server documentation at http://james.apache.org/server/2.3.1/index.html.

Creating Accounts in the Mail Server

After you have installed and configured your mail server, you have to create accounts. You need to create a mail account that represents the e-mail address of the Web Services Stack runtime. Additional accounts can be created to correspond to different clients.

Start of instruction setTo create an account

  1. Start the Apache James mail server if it is not started.

    To start Apache James Server, run the console command prompt, navigate to JAMES_HOME/bin directory and run run.bat.

  2. Start James Remote Manager Service (this tool is used for administration purposes).

    Run the console command prompt and type the following telnet command:

    telnet localhost 4555

    Port number 4555 is the default port, where the Remote Manager Service starts. It is configured in the James configuration file (JAMES_HOME/apps/james/SAR-INF/config.xml). If you have changed the default port number in a previous step, use the new value in the preceding command

  3. Log on the Remote Manager. You are prompted for the logon ID and password. They are configured in the James configuration file (JAMES_HOME/apps/james/SAR-INF/config.xml). The initial values are "root" for both, the ID and the password, unless you have changed them.

    Type "root" for the logon ID and for the password.

  4. Create the account. The command for adding a new user is adduser username password. After executing the command, you get a confirmation.

    Type the following command:

    adduser server wsstack
  5. Exit the Remote Manager Service using the quit command.

    After you have executed the commands in the command prompt, you get a result similar to the following one:

    >telnet localhost 4555
    
    	JAMES Remote Administration Tool 2.3.1
    	Please enter your login and password
    	Login id:
    	root
    	Password:
    	root
    	Welcome root. HELP for a list of command
    	adduser server wsstack
    	User server added
    	quit
    	Bye
    

Activating Mail Transport

There are prerequisites for the activation of mail transport. Refer to the following instructions and the description of the required parameters for the transport receiver and the transport sender.

Start of instruction setTo activate mail transport in Web Services Stack

  1. Open the axis2.xml configuration file under the webapps/wsstack/WEB-INF/conf directory for the Web Service Stack web application.

    Note:
    For Web Services Stack that uses Platform Tomcat Server the axis2.xml file is in the following directory: <Software AG_directory>/profiles/CTP/workspace/wsstack/repository/conf/.

  2. Configure the context root of Web Services Stack runtime.

    In the axis2.xml file, find the parameter with the name contextRoot. Uncomment it (if it is commented) and ensure that its value is "wsstack":

    <parameter name="contextRoot" locked="false">wsstack</parameter>
  3. Activate the mail transport receiver and the mail transport sender.

    In the axis2.xml file find and uncomment the sections that define the transport receiver and the transport sender with name=“mailto”:

    <transportReceiver name="mailto" … />
    <transportSender name="mailto" … />
    

    The parameters under the transport receiver and the transport sender have fake default values. They need to be verified.

    Required Parameters for the Transport Receiver

    The following table lists the required parameters and their description:

    Parameter Description
    mail.pop3.host

    The host name (or IP address) where the James mail server is running.

    If the server is running on the same machine as the Web Services Stack runtime, then the value can be "localhost" or "127.0.0.1".

    mail.pop3.user

    The user name of a user registered in the James mail server.

    The user name in the following sample code is the user registration from the example in the preceding topic "Creating accounts in the mail server".

    transport.mail.pop3.password

    The user’s corresponding password for his account.

    mail.store.protocol

    The value "pop3" is expected for that parameter.

    transport.mail.replyToAddress

    This parameter is responsible for the followng values:

    • Supplies the endpoint reference for the response and represents the server email address.

    • Contains the user name specified in the mail.pop3.user parameter and the server name of James mail server, separated by the @ sign.

      Note:
      The server name is configured in the JAMES_HOME/apps/james/SAR-INF/config.xml configuration file. If you have not specified a different one, the initial value is "localhost".

    transport.listener.interval

    Controls the time interval (in milliseconds) for checking the mail server for new messages.

    Note:
    This parameter is optional. If omitted, its default value is = "3000 " milliseconds (which equals to 3 seconds).

    Following is a sample code listing of the usage of the required parameters for the transport receiver:

    <transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
    	<parameter name="mail.pop3.host">localhost</parameter>
    	<parameter name="mail.pop3.user">server</parameter>
    	<parameter name="transport.mail.pop3.password">wsstack</parameter>
    	<parameter name="mail.store.protocol">pop3</parameter>
    	<parameter name="transport.mail.replyToAddress">server@localhost</parameter>
    	<parameter name="transport.listener.interval">3000</parameter>
    </transportReceiver>
    

    Required Parameters for the Transport Sender

    The following table lists the required parameters and its description:

    Parameter Description
    mail.smtp.host

    The host name (or IP address), where James mail server is running.

    It corresponds to the mail.pop3.host parameter under the Mail transport receiver.

    mail.smtp.user

    Corresponds to the value of the mail.pop3.user parameter of the transport receiver.

    transport.mail.smtp.password

    Corresponds to the value of the transport.mail.pop3.password parameter of the transport receiver.

    mail.smtp.from

    Corresponds to the value of the mail.transport.replyToAddress parameter of the transport receiver.

    Following is a sample code listing of the usage of the required parameter for the transport sender:

    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
    	<parameter name="mail.smtp.host" locked="false">localhost</parameter>
    	<parameter name="mail.smtp.user">server</parameter>
    	<parameter name="transport.mail.smtp.password">wsstack</parameter>
    	<parameter name="mail.smtp.from">server@localhost</parameter>
    </transportSender>
    

Forcing Deployment Over Mail Transport Only

If you want to restrict a web service to be deployed only over Mail transport, you must add the following element in the web service’s services.xml file:

<service ...>
	<transports>
		<transport>mailto</transport>
	</transports>
	...
</service>

Note:
If not configured explicitly, a web service is deployed over all activated transports in the Web Services Stack runtime.

Invoking a Web Service Over Mail Transport

To call a web service over mail transport, configure the client’s repository.

Start of instruction setTo configure the client's repository

  1. In the client’s axis2.xml configuration file, find and uncomment the sections that define the transport receiver and transport sender with name=“mailto”:

    <transportReceiver name="mailto" ... />
    <transportSender name="mailto" ... />
    
  2. Check the parameters under the mail transport receiver and the mail transport sender. You must configure the user name, the password, and the e-mail address of a user registered in the James mail server. That user must be different from the one configured in the Web Services Stack runtime.

    For details, see Activating Mail Transport.

Sample Client Configuration

Following is a sample code listing of client configuration with a user that is registered in the James mail server. The user name is "client" and the password is "pass":

<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
	<parameter name="mail.pop3.host">localhost</parameter>
	<parameter name="mail.pop3.user">client</parameter>
	<parameter name="mail.store.protocol">pop3</parameter>
	<parameter name="transport.mail.pop3.password">pass</parameter>
	<parameter name="transport.mail.replyToAddress">client@localhost</parameter>
	<parameter name="transport.listener.interval">3000</parameter>
</transportReceiver>

<transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
	<parameter name="mail.smtp.host">localhost</parameter>
	<parameter name="mail.smtp.user">client</parameter>
	<parameter name="transport.mail.smtp.password">pass</parameter>
	<parameter name="mail.smtp.from">client@localhost</parameter>
</transportSender>

Top of page