OK, and Weather Forecasting as VASP

MM7 examples include two services:

  • MM7 OK Service — Processes all types of MM7 events, demonstrating how to receive MM7 requests. For each received event, it generates a response indicating success. It uses both VASP and RS resource adaptors to act as both VASP and RS.

  • MM7 Weather Forecasting Service acting as VASP — Receives a DeliverReq message and generates a DeliverRes response, depending on the incoming request.

Building and deploying the examples

The build file defines targets to both deploy and undeploy the examples and all dependencies. ant -p will display a list:

Main targets:

 clean                    Remove compiled class and jar files
 deploy-mm7forecasting    Deploy MM7 forecasting service
 deploy-mm7ok             Deploy example MM7 OK Service
 deploy-rsra              Deploy MM7 Relay/Server RA
 deploy-vaspra            Deploy MM7 VASP RA
 undeploy-mm7forecasting  Undeploy MM7 forecasting service
 undeploy-mm7ok           Undeploy example MM7 OK Service
 undeploy-rsra            Undeploy MM7 Relay/Server RA
 undeploy-vaspra          Undeploy MM7 VASP RA

Running the MM7 Forecasting example service

To run the MM7 Forecasting example service:

1

Unzip the downloaded RA package and go to examples/.

2

Edit build.properties:

  • client.home must point to the client directory of a running Rhino instance.

  • common.localaddress and vasp.localport specify the address and port the MM7 VASP RA will attempt to listen on when it is activated. (The defaults are 0.0.0.0 (all interfaces) and port 2885.)

3

Deploy the MM7 Forecasting example:

  • Run the deploy-mm7forecasting target in the supplied Ant build file. This will deploy the MM7 VASP resource adaptor and the example MM7 service.

4

Send an MM7 request:

  • Use the send-request.xml Ant build file to compile and run the provided NetworkSender tool.

  • Run one of ask-weather-help, ask-weather-wgtn or ask-weather-all targets to send one of the provided template messages (src/com/opencloud/slee/tools/messages) representing an MM7 deliver request.

    ant -f send-request.xml ask-weather-help

    Example output:

    run-template:
    [java] Sending request to sbb:
    [java] POST /mms/weather.xml HTTP/1.1
    [java] host: opencloud.com
    [java] Content-Type: multipart/related; boundary="NextPart_000_0125_01C19839.7237929064"; type="text/xml"; start="</cmvt256/mm7-deliver>"
    [java] SOAPAction: ""
    [java] Connection: close
    [java]
    [java] --NextPart_000_0125_01C19839.7237929064
    [java] Content-Type:text/xml; charset="utf-8"
    [java] Content-ID: </cmvt256/mm7-deliver>
    [java]
    [java] <?xml version="1.0"?>
    [java] <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    [java] <env:Header>
    [java] <mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2" env:mustUnderstand="1">wlg1</mm7:TransactionID>
    [java] </env:Header>
    [java] <env:Body>
    [java] <DeliverReq xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
    [java] <MM7Version>5.3.0</MM7Version>
    [java] <Sender>
    [java] <RFC2822Address>97254265781@OMMS.com</RFC2822Address>
    [java] </Sender>
    [java] <Priority>Normal</Priority>
    [java] <Subject>forecast</Subject>
    [java] <Content href="cid:forecast-location2000102-86453"/>
    [java] </DeliverReq>
    [java] </env:Body>
    [java] </env:Envelope>
    [java]
    [java] --NextPart_000_0125_01C19839.7237929064
    [java] Content-Type: text/plain;charset="utf-8"
    [java] Content-ID: <forecast-location2000102-86453>
    [java]
    [java] Akld
    [java] Haml
    [java] PlmN
    [java] Wgtn
    [java] Chch
    [java] Dund
    [java] --NextPart_000_0125_01C19839.7237929064--
    [java]
    [java] Waiting for response from sbb...
    [java]
    [java] Recived response from sbb:
    [java] HTTP/1.1 200 OK
    [java] Content-Type: text/xml; charset="utf-8"
    [java] Server: RhinoMM7-6.8.0/1.1
    [java] Date: Mon, 21 Mar 2011 21:07:11 GMT
    [java] Connection: close
    [java] Content-Length: 730
    [java]
    [java] <?xml version="1.0" encoding="UTF-8"?>
    [java] <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header><mm7:TransactionID xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2" env:mustUnderstand="1">wlg1</mm7:TransactionID></env:Header><env:Body><DeliverRsp xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2"><MM7Version>5.3.0</MM7Version><Status><StatusCode>1000</StatusCode><StatusText>Success</StatusText><Details><Text>
    [java] Outlook for Akld: Hail
    [java] Outlook for Haml: Thunderstorms
    [java] Outlook for PlmN: Cloudy
    [java] Outlook for Wgtn: Snowing
    [java] Outlook for Chch: Cloudy
    [java] Outlook for Dund: Cloudy</Text></Details></Status></DeliverRsp></env:Body></env:Envelope>
Previous page