Versions Compared

Key

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

The topics in this section describe how you can quickly configure and test a single node On-Prem Gateway deployment and a high availability deployment scenario. 

Tip

If you want to run the On-Prem Gateway on Docker, see Deploying the On-Prem Gateway as a Docker Container


Table of Contents
maxLevel3
minLevel3

...

  1. Log in to WSO2 API Cloud and create an API.
  2. Subscribe to and invoke the API.
  3. Invoke the API using curl .
    The curl command to invoke the GET method of the API should be similar to the following:

    Code Block
    curl -k -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’
    'https://gateway.api.cloud.wso2.com:443/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'

    Replace https://gateway.api.cloud.wso2.com:443 in the above curl command with your On-Prem Gateway URL as indicated below, and run it. The response to this curl should be identical to that received in the previous step.

    Code Block
    curl -k -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’
    'https://on-premise-gateway-ip:8243/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
    Info

    Note that you can also use the HTTP port for API invocations. The HTTP port number would be 8280 by default. An example is given below.

    Code Block
    curl -X GET --header 'Accept: text/xml' --header 'Authorization: Bearer dXNlckBvcmcuY29tQHRlc3RPcmcxMjM6UGFzc3dvcmQ=’
    'http://on-premise-gateway-ip:8280/t/ccc2222/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
    Info

    When you run multiple On-Prem Gateway instances on the same server or virtual machine (VM), you must change the default port of each Gateway with an offset value to avoid port conflicts. An offset defines the number by which all ports in the runtime (e.g., HTTP/S ports) will be increased. For example, if the default HTTPS port is 8243 and the offset is 1, the effective HTTPS port will change to 8244. For each additional On-Premise Gateway instance that you run in the same server or virtual machine, you have to set the port offset to a unique value. The offset of the default port is considered to be 0.

    There are two ways to set an offset to a port:

    • Pass the port offset to the server during start up. The following command starts the server with the default port incremented by 1.
    Code Block
    ./wso2server.sh -DportOffset=1
    • Set the port offset in the Ports section in the <ON-PREM_GATEWAY_HOME>/repository/conf/carbon.xml file as shown below.
    Code Block
    <Offset>1</Offset>
  4. If  your request is successful, your response will be similar to the following.

    Code Block
    <?xml version="1.0" encoding="utf-8"?>
    <PhoneReturn xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ws.cdyne.com/PhoneVerify/query">
      <Company>Toll Free</Company>
      <Valid>true</Valid>
      <Use>Assigned to a code holder for normal use.</Use>
      <State>TF</State>
      <RC />
      <OCN />
      <OriginalNumber>18006785432</OriginalNumber>
      <CleanNumber>8006785432</CleanNumber>
      <SwitchName />
      <SwitchType />
      <Country>United States</Country>
      <CLLI />
      <PrefixType>Landline</PrefixType>
      <LATA />
      <sms>Landline</sms>
      <Email />
      <AssignDate>Unknown</AssignDate>
      <TelecomCity />
      <TelecomCounty />
      <TelecomState>TF</TelecomState>
      <TelecomZip />
      <TimeZone />
      <Lat />
      <Long />
      <Wireless>false</Wireless>
      <LRN />
    </PhoneReturn>

...