uCosminexus Service Platform, Reception and Adapter Definition Guide

[Contents][Glossary][Index][Back][Next]

Appendix F.2 Setup example of HTTP reception (in pass-through mode)

This section describes an example of setting up an HTTP reception for a business process executed in pass-through mode.

Organization of this subsection
(1) Overview of setup example
(2) Creating the message format of the HTTP reception
(3) Adding an HTTP reception
(4) Defining the HTTP reception
(5) Defining the business process
(6) Invoking the HTTP reception

(1) Overview of setup example

This subsection describes the system configuration and flow of processing in this setup example.

The following figure shows an example of the system configuration:

Figure F-3 System configuration in setup example (pass-through mode)

[Figure]

In pass-through mode, the business process is invoked by directly specifying the request message (XML) of the HTTP reception in a Web browser.

(2) Creating the message format of the HTTP reception

Use the same procedure as in F.1(2) Creating the message formats for the HTTP reception.

(3) Adding an HTTP reception

Use the same procedure as in F.1(3) Adding the HTTP reception.

(4) Defining the HTTP reception

(a) Settings in the User Definition Reception window (basic)

Use the same settings as in F.1(4)(a) Settings in the User Definition Reception window (basic) window.

(b) Editing the HTTP Response Header definition file

Use the same procedure as in F.1(4)(b) Editing the HTTP Response Header definition file.

(c) Editing the HTTP reception definition file

Use the same procedure as in F.1(4)(c) Editing the HTTP reception definition file. However, for pass-through mode, specify true for the httprecp.switchover.pass-through.mode property. The following is an example of the information you need to set:

 
#urecp-http.context-root=
#urecp-http.max-threads=10
#urecp-http.exclusive-threads=0
#urecp-http.queue-size=8192
#urecp-http.pooled-instance.minimum=0
#urecp-http.pooled-instance.maximum=0
#urecp-http.ejb-transaction-timeout=0
httprecp.switchover.pass-through.mode=true
httprecp.http.charset=UTF-8
httprecp.response.header.filename=cscurecphttp_header.properties
#httprecp.system-exception.status-code=500
#httprecp.response.generate.content-length=true
 

(5) Defining the business process

Use the same procedure as in F.1(5) Defining the business process.

(6) Invoking the HTTP reception

In pass-through mode, you directly specify the request message of the HTTP reception in your Web browser. In this example, the HTTP reception is invoked using the following HTML (POST method):

  1. Create the following HTML file and display it in your Web browser:
    • sample.html
       
      <html>
        <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      </head>
        <body>
          <form method="POST" action="http://localhost/rcp1/calculateDistance">
            <label>Pass-through mode: URL = http://localhost/rcp1/calculateDistance</label><br>
            <textarea name=msg rows=15 cols=140 wrap=soft>Enter the request message (XML). </textarea><br>
            <input type="submit" value="POST Submit" />
          </form>
        </body>
      </html>
       
    • Page displayed in Web browser:

      [Figure]

  2. Enter the request message for the HTTP reception in the input area.
    Because this example uses the same business process as the example for standard mode, specify the request message you defined for that example in F.1(2) Creating the message formats for the HTTP reception.
     
    <?xml version="1.0" encoding="UTF-8" ?>
    <hrc:http-body-request
     xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/reception/http/request"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/reception/http/request urecp_http_body_request.xsd ">
      <hrc:parameter>
        <hrc:kilometers_per_hour>80</hrc:kilometers_per_hour>
        <hrc:hours>25</hrc:hours>
      </hrc:parameter>
    </hrc:http-body-request>
     
  3. Click the Execute by POST button.
    The results appear in the Web browser. The results are as follows:

    [Figure]