Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Open the component to setup the configuration in HTTPStub Configuration Property Sheet (CPS).

Component Configuration

The component has the following attributes which can be configured from its CPS. The figure below illustrates the panel with Expert Properties enabled.

Image RemovedImage Added
Figure 1: Configurable properties for HTTPStub component.

...

Code Block
http://<PEER_SERVER_IP>:<PEER_SERVER_HTTP_PORT>/<CONTEXT_ROOT>/<CONTEXT_NAME

Context Description

A brief description of the context which will be displayed in HTTP gateway, for example, stating the purpose of the context.

Is One Way

Determines whether a response has to be sent back to client invoking the service.

...

  • If disabled, response is sent after processing the request. Two input ports RESPONSE and FAILURE will be added in addition to the output port to send response and error details and to receive response and error details respectively from the event process.

    Note

    The properties Response details and Error details will not be present if this property is set to yes.

Store imported schemas

Enables to save schemas in Schema Repository.

Elements to Decrypt and Elements to Encrypt

Please refer the respective sections in the Common Configurations page.

FES Connection Configuration

Details of Enterprise Server Connection can be provided by clicking the ellipses Image Removed button.

Image Removed
Figure 2: Properties in Fes Connection Configuration dialog box

Use connection details from FPS

Enable this property if the FPS connection configuration has to be the same as the FES configuration.

URL

The URL of enterprise server to which the peer server on which the component is running is connected.

Backup URL

The alternate URL that should be tried for connecting to the enterprise server if the enterprise server cannot be connected to using the URL mentioned against property FES URL.

Note

In case of enterprise servers in HA mode, this should point to secondary server URL if the primary is set against Server URL property and vice-versa.

Username

User name that should be used to connect to the enterprise server.

Password

Password that should be used to connect to the enterprise server.

Server Call Timeout

Sets the timeout for the calls made to the Enterprise Server. By default it is set to 180 Seconds. 
This value should be increased to avoid timeout with the Enterprise server while launching Components.

Execution Configuration

This section helps in configuring details of Execution, Request, Response and Error.

...


Figure 4: Request Details – Parameters.

Parameters

Parameters define the characteristics of the HTTP request data stream being parsed for converting the request to message. Parameters can be added by clicking Add button in the Parameters tab of the request details editor as shown in the figure above. Added parameters can be removed by clicking on the Remove button.

...

If the client expects the error to be compliant to a particular schema, then the schema is provided using the schema editor as shown in the above figure. The schema is set as schema of the input port FAILURE.

Expert Properties

Enable the Expert Properties view to configure these properties.

Warning

Expert properties are meant for advanced users; use with caution.

 

Image Added
Figure 8: Expert properties for HTTPStub

Deployment Configuration

Pre Processing XSL Configuration

Pre Processing XSL configuration can be used to transform request message before processing it. Click the ellipses button against the property to configure the properties.

Refer to the Pre/Post Processing XSL Configuration section under the Common Configurations page for details regarding Pre Processing XSL configuration and Post Processing XSL configuration (below).

Post Processing XSL Configuration 

Post Processing XSL configuration can be used to transform the response message before sending it to the output port.

 

Threadpool Configuration

 

This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective. 

Please refer to the respective section in the Common Configurations page.

Store imported schemas

Enables to save schemas in Schema Repository.

Elements to Decrypt and Elements to Encrypt

Please refer to the respective sections in the Common Configurations page.

FES Connection Configuration

Details of Enterprise Server Connection can be provided by clicking the ellipses button.

Image Added
Figure 9: Properties in Fes Connection Configuration dialog box

Use connection details from FPS

Enable this property if the FPS connection configuration has to be the same as the FES configuration.

URL

The URL of the enterprise server to which the peer server on which the component is running is connected.

Backup URL

The alternate URL that should be tried for connecting to the enterprise server if the enterprise server cannot be connected to using the URL mentioned against property FES URL.

Note

In case of enterprise servers in HA mode, this should point to secondary server URL if the primary is set against Server URL property and vice-versa.

Username

User name that should be used to connect to the enterprise server.

Password

Password that should be used to connect to the enterprise server.

Server Call Timeout

Sets the timeout for the calls made to the Enterprise Server. By default it is set to 180 Seconds. 
This value should be increased to avoid timeout with the Enterprise server while launching Components.

SSL Configuration

Please refer SSL Security section in the Common Configurations page.

...

When Parameters are added (param1) and Post Data is set to '--------' or when Post Data is set to 'Bytes', then schema set on port REQUEST is defined as shown in Figure 8 and a sample XML in Figure 9.

Image RemovedImage Added
Figure 810: Output Schema with parameters and no post data

Image Modified
Figure 911: Output XML with parameters and no post data.

...

When Post Data is set to Simple Text, then schema set on port REQUEST is defined as shown in Figure 10 and a sample XML in Figure 11.

Image RemovedImage Added
Figure 1012: Output Schema with Post Data set to Simple Text.

Image Modified
Figure 1113: Output XML with Post Data set to Simple Text.

...

When Post Data is set to 'XML Text', schema provided in Request details is set under XMLData element in output schema on port REQUEST. The schema set on port REQUEST is defined as shown in Figure 12 and a sample XML in Figure 13.

Image RemovedImage Added
Figure 1214: Output Schema with Post Data set to XML.

Image Modified
Figure 1315: Output XML with Post Data set to XML.

...

Configure the component with Response Details set to Simple Text and parameters are configured in request details as shown in the figure below.

Image Modified
Figure 1416:Sample Configuration of parameters.

Below figure shows a sample event process with HTTPStub

Image Modified
Figure 1517: Demonstrating Scenario 1

When the flow is launched, the HTTP context is deployed based on the configuration provided. Right-click the component and use the option 'View HTTP Context ' to view the deployed context. HTTPAdapters component can be used to send the request to the service. When a request is sent, a sample output message that is sent to output port REQUEST is shown below.

...

The below figure demonstrates how HTTPStub can be used to deploy a mailing service as a context in HTTP Gateway.


Figure 16 18: Deploying SMTP service using HttpStub

In the flow, HTTPStub is configured to take the Request as XML and the schema is set as same as that of the input port of SMTP component. The XMLData element is mapped to the input schema of the SMTP component child to child recursively using Xslt Component. The Response is also chosen as XML and schema is set to be that of the output port of the HttpStub component. The error schema is set that of *ON_EXCEPTION port of SMTP component.

...

In Order Entry sample, you can find a web based interface to send a purchase order to a company. In case the order is accepted, HTTPAdapters is used to POST the order delivery request to a third party vendor. In an Order Entry scenario, the HTTPStub can be used for receiving orders as HTTP requests.


Figure 1719: Order Entry

The event process demonstrating this scenario is bundled with the installer. The Http Stub is used instead of the HTTP Receive.

...

  • If both Primary and Secondary servers are on the same machine:
    Initially, if HttpStub is launched on the Primary server and the generated HTTP Context contains Primary server jetty port number. In case of failover, the primary server shuts down and the secondary server becomes Active and relaunches the component. If the secondary server uses a different jetty port then the generated context URL will be changed since the jetty port is different. The clients have to be reconfigured to use a new URL in this case.
    To avoid this situation, it is recommended to use the same jetty ports for both primary and secondary peer servers.
    Jetty service will be started only after the server started successfully. In case of HA, only one server will be active at a given time and the Jetty server will be running only in the active server and there will be no bind exceptions even if both the servers use same port number for Jetty.
  • If both Primary and Secondary servers are on different machines:
    In this case, if the failover happens the hostname/IP address in the context URL will be changed. So the clients have to be reconfigured accordingly.
    • HTTP headers are received from the gateway as message properties with the header name prefixed with http_.
      Example: http_Content-Type.
    • Right-click on the component and use the option 'View HTTP Context ' to view the deployed context.
Adaptavist ThemeBuilder EngineAtlassian Confluence