3 Web Methods

FidelioSPMSWSJsonGet

This function supports JSON GET method and JSONP GET method . It does not support JSON POST method.

Input Parameters

Table 3-1 FidelioSPMSWSJsonGet Input Parameters

Parameter Type Description Required

psFunction

String

Function to call.

Yes

psSessionID

String

Session ID.

Yes

psParam

Array of String

The field value will depend on the Function. Please refer to function detail for each available parameters.

Optional

The following section describes the parameters.

psFunction

The ‘psFunction’ is the function name to be called.

psSessionID

The SessionID is a unique ID returned by OHCWebServices after a successful login function. This field is required in all function calls except login function.

The session has an idle timeout of between 5 to 15 minutes from the last function call and value is configurable from the Database Parameter. The default value is 5 minutes.

PAR("WebService", "Session Idle Timeout")

When a function call and returns a session expiry error, please re-verify by performing another function call. If it again fail for the same error, you should then re-login and retry.

Const SESSIONEXPIRY = "Session Expired"
Const INVALIDSESSIONID = "Invalid Session ID or Session Expiry"

When a function call returns similar error to the one shown below, you must change the password and retry.

Const PLEASECHANGEPASSWORD = "Please change your password first"

poParam

The field value depends on the Function called. Please refer to the function details for each available parameters.

Return Values

Return the following Class value. The variable bSuccess is used to determine if the function call is successful or unsuccessful. If unsuccessful, sErrMsg will populate with the error message. All other fields will depend on the function call.

Public Class CResponseJson
    Public bSuccess As Boolean
    Public sErrMsg As String
    Public sTables As String
    Public nTotalPage As Integer
    Public sPackageInfo As String
    Public sCrewInvoice As String
    Public sObj As String
  End Class

Note:

  • oDataSet, oPassenger, oGuestInfo, oGuest and oAdvanceLoyalty will be serialized to sTables.

  • oPackageInfo will be serialized to sPackageInfo.

  • oCrewInvoice will be serialized to sCrewInvoice.

  • oObj will be serialized to sObj and sTables.

If oDataSet, oPassenger, oGu0estInfo, oGuest and oAdvanceLoyalty is ‘Nothing’, you may ignore them as this is returned for backward compatibility.

Sample JSONP

The requirement is that you must pass in the callback and format=json parameter.

GET /OHCWebServices/OHCWebServices.asmx/FidelioSPMSWSJsonGet?callback="Testing"&psFunction='WSFunction'&psSessionID='SessionID'&psParam=['GetCabin','05002']&format=json HTTP/1.0

Host: localhost 

Or

https://localhost/OHCWebServices/OHCWebServices.asmx/FidelioSPMSWSJsonGet?callback="Testing"&psFunction='WSFunction'&psSessionID='SessionID'&psParam=['GetCabin','05002']&format=json

Below are sample responses that return two tables.

Note: The Testing() is a JSONP response.

Testing(
  {
    "bSuccess":true,
    "sErrMsg":"",
    "sTables":"{
                "Table1": {
                            "CAB_ID": "05002               ",
                            "CAB_DECK": "D05   ",
                            "DECK_DESC": "DECK 05",
                            "CAB_DESIGN": "P",
                            "CAB_TYPE": "CD4   ",
                            "TYPE_DESC": "CD4 - O/C Porthole (D4, D5, D6)",
                            "CAB_STATION": "B     ",
                            "MST_NAME": "ASSEMBLY STATION B",
                            "CAB_MODDATE": "2011-10-27T10:26:43"
                          },
                "Table2": [
                            {
                              "TYP_ART": "D00   ",
                              "TYP_COMMENT": "SEAT 1"
                            },
                            {
                              "TYP_ART": "D02   ",
                              "TYP_COMMENT": "DECK 02"
                            },
                            {
                              "TYP_ART": "D03   ",
                              "TYP_COMMENT": "DECK 03"
                            },
                            {
                              "TYP_ART": "D04   ",
                              "TYP_COMMENT": "DECK 04"
                            },
                            {
                              "TYP_ART": "D05   ",
                              "TYP_COMMENT": "DECK 05"
                            },
                            {
                              "TYP_ART": "D06   ",
                              "TYP_COMMENT": "DECK 06"
                            },
                            {
                              "TYP_ART": "D07   ",
                              "TYP_COMMENT": "DECK 07"
                            },
                            {
                              "TYP_ART": "D08   ",
                              "TYP_COMMENT": "DECK 08"
                            },
                            {
                              "TYP_ART": "D09   ",
                              "TYP_COMMENT": "DECK 09"
                            },
                            {
                              "TYP_ART": "D10   ",
                              "TYP_COMMENT": "DECK 10"
                            },
                            {
                              "TYP_ART": "D11   ",
                              "TYP_COMMENT": "DECK 11"
                            },
                            {
                              "TYP_ART": "D12   ",
                              "TYP_COMMENT": "DECK 12"
                            },
                            {
                              "TYP_ART": "D88   ",
                              "TYP_COMMENT": "PAX TEMP CABIN"
                            },
                            {
                              "TYP_ART": "D99   ",
                              "TYP_COMMENT": "CREW TEMP CABIN"
                            }
                          ]
                }"
  }
);

Sample JSON

The requirement is you must pass in the format=json parameter

GET /OHCWebServices/OHCWebServices.asmx/FidelioSPMSWSJsonGet?psFunction='WSFunction'&psSessionID='SessionID'&psParam=['GetCabin','05002']&format=json HTTP/1.0
Host: localhost
 Or
http://localhost/OHCWebServices/OHCWebServices.asmx/FidelioSPMSWSJsonGet?psFunction='WSFunction'&psSessionID='SessionID'&psParam=['GetCabin','05002']&format=json

Below are the sample response that returns two tables, and the text in red represents the second table.

{
  "bSuccess":true,
  "sErrMsg":"",
  "sTables":"{"Table1": {
                          "CAB_ID": "05002               ",
                          "CAB_DECK": "D05   ",
                          "DECK_DESC": "DECK 05",
                          "CAB_DESIGN": "P",
                          "CAB_TYPE": "CD4   ",
                          "TYPE_DESC": "CD4 - O/C Porthole (D4, D5, D6)",
                          "CAB_STATION": "B     ",
                          "MST_NAME": "ASSEMBLY STATION B",
                          "CAB_MODDATE": "2011-10-27T10:26:43"
                        },
              "Table2": [
                          {
                            "TYP_ART": "D00   ",
                            "TYP_COMMENT": "SEAT 1"
                          },
                          {
                            "TYP_ART": "D02   ",
                            "TYP_COMMENT": "DECK 02"
                          },
                          {
                            "TYP_ART": "D03   ",
                            "TYP_COMMENT": "DECK 03"
                          },
                          {
                            "TYP_ART": "D04   ",
                            "TYP_COMMENT": "DECK 04"
                          },
                          {
                            "TYP_ART": "D05   ",
                            "TYP_COMMENT": "DECK 05"
                          },
                          {
                            "TYP_ART": "D06   ",
                            "TYP_COMMENT": "DECK 06"
                          },
                          {
                            "TYP_ART": "D07   ",
                            "TYP_COMMENT": "DECK 07"
                          },
                          {
                            "TYP_ART": "D08   ",
                            "TYP_COMMENT": "DECK 08"
                          },
                          {
                            "TYP_ART": "D09   ",
                            "TYP_COMMENT": "DECK 09"
                          },
                          {
                            "TYP_ART": "D10   ",
                            "TYP_COMMENT": "DECK 10"
                          },
                          {
                            "TYP_ART": "D11   ",
                            "TYP_COMMENT": "DECK 11"
                          },
                          {
                            "TYP_ART": "D12   ",
                            "TYP_COMMENT": "DECK 12"
                          },
                          {
                            "TYP_ART": "D88   ",
                            "TYP_COMMENT": "PAX TEMP CABIN"
                          },
                          {
                            "TYP_ART": "D99   ",
                            "TYP_COMMENT": "CREW TEMP CABIN"
                          }
                        ]
              }"
}

FidelioSPMSWSJsonPost

This function supports JSON POST method only. It does not support JSON GET method and JSONP GET method.

Table 3-2 FidelioSPMSWSJsonPost Input Parameters

Parameter Type Description Required

psFunction

String

Function to call.

Yes

psSessionID

String

Session ID.

Yes

psParam

Array of String

The field value will depend on the Function. Please refer to function detail for each available parameters.

Optional

Below are the descriptions of the parameters.

psFunction

The ‘psFunction’ is the function name to be called.

psSessionID

The SessionID is a unique ID returned by SPMS OHCWebServices after a successful login function. This field is required for all function calls except login function.

The session has an idle timeout of between 5 to 15 minutes from the last function call and value is configurable from the Database Parameter. The default value is 5 minutes.

PAR("WebService", "Session Idle Timeout")

When a function call returns a session expiry error, then please re-verify by performing another function call. If it again fails for the same error, you should then re-login and retry.

Const SESSIONEXPIRY = "Session Expired"

Const INVALIDSESSIONID = "Invalid Session ID or Session Expiry"

When you call a function and it returns the error below, you must change the password and retry.

Const PLEASECHANGEPASSWORD = "Please change your password first"

poParam

The field value depends on the function called. Please refer to the function details for each available parameters.

Return Values

Return the following Class value. The variable bSuccess is used to determine if the function call is successful or unsuccessful. If unsuccessful, sErrMsg will populate with the error message. All other fields will depend on the function call.

  Public Class CResponseJson
    Public bSuccess As Boolean
    Public sErrMsg As String
    Public sTables As String
    Public nTotalPage As Integer
    Public sPackageInfo As String
    Public sCrewInvoice As String
    Public sObj As String
  End Class

Note:

  • oDataSet, oPassenger, oGuestInfo, oGuest and oAdvanceLoyalty will be serialized to sTables.

  • oPackageInfo will be serialized to sPackageInfo.

  • oCrewInvoice will be serialized to sCrewInvoice.

  • oObj will be serialized to sObj and sTables.

Sample JSON

The requirement is that you must pass in the

Content-Type: application/json; charset=utf-8 
POST /OHCWebServices/OHCWebServices.asmx/FidelioSPMSWSJsonPost 
HTTP/1.0 Host: localhost
Content-Type: application/json; charset=utf-8 
Content-Length: 69
{psFunction:'WSFunction',psSessionID:'SessionID',psParam:['GetCabin','05002']}

Below is the sample response that return two tables.

{
  "bSuccess":true,
  "sErrMsg":"",
  "sTables":"{"Table1": {
                          "CAB_ID": "05002               ",
                          "CAB_DECK": "D05   ",
                          "DECK_DESC": "DECK 05",
                          "CAB_DESIGN": "P",
                          "CAB_TYPE": "CD4   ",
                          "TYPE_DESC": "CD4 - O/C Porthole (D4, D5, D6)",
                          "CAB_STATION": "B     ",
                          "MST_NAME": "ASSEMBLY STATION B",
                          "CAB_MODDATE": "2011-10-27T10:26:43"
                        },
              "Table2": [
                          {
                            "TYP_ART": "D00   ",
                            "TYP_COMMENT": "SEAT 1"
                          },
                          {
                            "TYP_ART": "D02   ",
                            "TYP_COMMENT": "DECK 02"
                          },
                          {
                            "TYP_ART": "D03   ",
                            "TYP_COMMENT": "DECK 03"
                          },
                          {
                            "TYP_ART": "D04   ",
                            "TYP_COMMENT": "DECK 04"
                          },
                          {
                            "TYP_ART": "D05   ",
                            "TYP_COMMENT": "DECK 05"
                          },
                          {
                            "TYP_ART": "D06   ",
                            "TYP_COMMENT": "DECK 06"
                          },
                          {
                            "TYP_ART": "D07   ",
                            "TYP_COMMENT": "DECK 07"
                          },
                          {
                            "TYP_ART": "D08   ",
                            "TYP_COMMENT": "DECK 08"
                          },
                          {
                            "TYP_ART": "D09   ",
                            "TYP_COMMENT": "DECK 09"
                          },
                          {
                            "TYP_ART": "D10   ",
                            "TYP_COMMENT": "DECK 10"
                          },
                          {
                            "TYP_ART": "D11   ",
                            "TYP_COMMENT": "DECK 11"
                          },
                          {
                            "TYP_ART": "D12   ",
                            "TYP_COMMENT": "DECK 12"
                          },
                          {
                            "TYP_ART": "D88   ",
                            "TYP_COMMENT": "PAX TEMP CABIN"
                          },
                          {
                            "TYP_ART": "D99   ",
                            "TYP_COMMENT": "CREW TEMP CABIN"
                          }
                        ]
              }"
}

FidelioSPMSWSXML

This function only supports Simple Object Access Protocol (SOAP).

Table 3-3 FidelioSPMSWSXML Input Parameters

Parameter Type Description Required

psFunction

String

Function to call.

Yes

psSessionID

String

Session ID.

Yes

poParam

Array of Object

The field value will depend on the Function. Please refer to function detail for each available parameters.

Optional

psFunction

The ‘psFunction’ is the function name to be called.

psSessionID

The SessionID is a unique ID returned by SPMS OHCWebServices after a successful login function. This field is required in all function calls except login function.

The session has an idle timeout of between 5 to 15 minutes from the last function call and value is configurable from the Database Parameter. The default value is 5 minutes..

PAR("WebService", "Session Idle Timeout")

When a function call returns a session expiry error, then please re-verify by performing another function call. If it again fails for the same error, you should then re-login and retry.

Const SESSIONEXPIRY = "Session Expired"

Const INVALIDSESSIONID = "Invalid Session ID or Session Expiry"

When a function call returns similar error to the one shown below, you must change the password and retry.

Const PLEASECHANGEPASSWORD = "Please change your password first"

Do make sure you change the app.config in order for this to work.

<readerQuotas maxDepth="32" maxStringContentLength="100000" maxArrayLength="16384"

poParam

The field value depends on the function called. Please refer to the function details for each available parameters.

Return Values

Return the below Class value. The variable bSuccess is used to determine if the function call is successful or fails. If fail, sErrMsg will be populated with the error message. All other fields depend on the function call.

Public Class CResponseXml
  Public bSuccess As Boolean
  Public sErrMsg As String
  Public oTables() As Data Table
  Public oPassenger As CPassenger
  Public oGuestInfo() As CiPos.iGuestInfo
  Public oObj As Object
  Public oPeopleCount As CFCSecurity.PeopleCount
  Public oAdvanceLoyaltyDiscount As CiPos.CAdvanceLoyaltyDiscount
  Public nTotalPage As Integer
  Public oCreditCard As COHCCreditCard
  Public oTerminal As TerminalNotification
End Class

Sample XML

Public goWS As New FidelioSPMSWS.FidelioSPMSWSSoapClient

Dim oResponse As FidelioSPMSWS.CResponseXml

oResponse = goWS.FidelioSPMSWSXML("WSFunction", _
                                  "Session", _
                                  New Object() {"GetCabin", _
                                                "05002"})