Samples for mGw client library
-----------------------------------------------------------

1) Prerequisite
Contant your mobile operator for mGw parlayX services URL address and 
username-password pair for authentication to various services. There are SMS, 
MMS, Location and Charging samples and for every sample different 
username-password pair is used (depending on mGw configuration).

2) Send samples
Change your current directory to samples/send directory. There are four 
scripts for every sample. Each sample use default configuration file which 
contains sample properties. You can override default configuration by 
specifying your configuration file as first parameter to sample scripts.

Four sample scripts with default configuration files are:
- sms_sample.sh        conf/sms_sample.conf
- mms_sample.sh        conf/mms_sample.conf
- location_sample.sh   conf/location_sample.conf
- charging_sample.sh   conf/charging_sample.conf

Before script is executed check configuration file and set valid properties
values. At least mm2.service-url (mGw parlayX services URL), mm2.username and 
mm2.password parameters will have to be set.

Every script contains one or more examples. Specify which example to execute
when script in run by setting example.X property in configuration file, where X
is example number. True (case ignored) indicate example will be executed. Any 
other value will skip example.

Check source files to examine what every sample example will do.

3) Receive sample
To execute receive (notification) sample deploy war file in samples/receive
directory to any servle container. On Apache Tomcat place war file in webapps 
directory and start Apache Tomcat. For others servlet containers consult manual 
to find out how to deploy war file.

In order to receive messages mGw must know your URL address where to send 
messages. Your URL address will be something similar to this:
  http://my-host-name-or-ip:servlet-container-port/receive-sample/services/SmsNotificationPort
for sms port and
  http://my-host-name-or-ip:servlet-container-port/receive-sample/services/MmNotificationPort
for mms port.
You have to fill in my-host-name-or-ip and servlet-container-port.

Deployed this way receive sample will accept only incoming SMS messages.
To accept MMS messages you have to edit web.xml file. This is necessary since 
received MMS message contains only message reference and message content must 
be explicitly requested with received message reference. 
In web.xml file set:
  a) mm2.service-url to point to mGw parlayX services URL
  b) mm2.username and mm2.password pair used for authentication
Restart servlet container to reload changed values.

4) Source code
Source code of samples is included and can be found in samples/src directory.
