3 Web Methods

FidelioSPMSWSJsonGet

This function supports JSON get and JSONP get and does not support JSON post.

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 is the description of the parameters.

psFunction

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

psSessionID

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

The session has a timeout of 60 minutes from the last function call and value is configurable in the web.config file.

<add key="Idle Timeout" value="60"/>

When a function is called and if it returns below error, you must reverify by performing another function call. If failed, 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 below error, 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 below Class value. The variable bSuccess is used to determine if the function call is successful or fail. If fail, sErrMsg will be populated with the error message. All other field 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’, then this is for backward compatibility.

Sample JSONP

The requirement is 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
http://localhost/OHCWebServices/OHCWebServices.asmx/FidelioSPMSWSJsonGet?callback="Testing"&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.

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 only. It does not support JSON get and JSONP get.

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 description of the parameters.

psFunction

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

psSessionID

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

The session has a timeout of 60 minutes from the last function call and value is configurable in the web.config file.

<add key="Idle Timeout" value="60"/>

When a function is called and if it returns below error, you must reverify by performing another function call.If failed, 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 below error, 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 below Class value. The variable bSuccess is used to determine if the function call is successful or fail. If fail, sErrMsg will be populated with the error message. All other field 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 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 and the text in red represent 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"
                          }
                        ]
              }"
}

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 WebService after a successful login function. This field is required in all function calls except login function.

The session has a timeout of 60 minutes from the last function call and value is configurable in the web.config file.

<add key="Idle Timeout" value="60"/>

When a function is called and if it returns below error, you must reverify by performing another function call.If failed, 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 below error, you must change the password and retry.

Const PLEASECHANGEPASSWORD = "Please change your password first"

Please 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 fail. If fail, sErrMsg will be populated with the error message. All other field will 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

For example,

Public goWS As New FidelioSPMSWS.FidelioSPMSWSSoapClient

Dim oResponse As FidelioSPMSWS.CResponseXml

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