Travelport / travelport-uapi-tutorial-c-sharp

The travelport-uapi-tutorial-c-sharp is a C# project for Universal API that will help you connect and code a standard Air availablity call and Hotel search, details, and booking flow.
35 stars 30 forks source link

No enum constant com.g2switch.core.service.Provider #206

Open rxa092 opened 3 years ago

rxa092 commented 3 years ago

I am trying to call the terminal service uapi and my current xml is

<?xml version="1.0" encoding="utf-16"?>
<TerminalReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TargetBranch="P3090173">
  <BillingPointOfSaleInfo OriginApplication="UAPI" xmlns="http://www.travelport.com/schema/common_v33_0" />
  <HostToken Host="XXXX" Key="123456" xmlns="http://www.travelport.com/schema/common_v33_0">Raza</HostToken>
  <TerminalCommand xmlns="http://www.travelport.com/schema/terminal_v33_0">*AB124</TerminalCommand>
</TerminalReq>

Currently I am getting an error: No enum constant `com.g2switch.core.service.Provider.XXXX

But I cannot find the enum through which I can verify the host value how can I resolve this

vivekjyotipramanik commented 3 years ago

Hi rxa092,

The Host attribute is optional. Could you please remove it and give it a try. Thanks.

https://support.travelport.com/webhelp/uapi/uapi.htm#../Subsystems/Schemas/Content/Schemas/TerminalReq.html

rxa092 commented 3 years ago

on removing the host attribute the xml created is

<?xml version="1.0" encoding="utf-16"?>
<TerminalReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TargetBranch="P3090173">
  <BillingPointOfSaleInfo OriginApplication="UAPI" xmlns="http://www.travelport.com/schema/common_v33_0" />
  <TerminalCommand xmlns="http://www.travelport.com/schema/terminal_v33_0">*G5K0GW</TerminalCommand>
</TerminalReq>

The exception now is Error unmarshalling message body: Expected "{http://www.travelport.com/schema/common_v33_0}HostToken" start tag, found "{http://www.travelport.com/schema/terminal_v33_0}TerminalCommand" start tag

vivekjyotipramanik commented 3 years ago

Hi rxa092,

I actually asked you to remove the Host attribute, not the HostToken element. Please try with the below xml. Thanks.

<?xml version="1.0" encoding="utf-16"?>
<TerminalReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TargetBranch="P3090173">
  <BillingPointOfSaleInfo OriginApplication="UAPI" xmlns="http://www.travelport.com/schema/common_v33_0" />
  <HostToken Key="123456" xmlns="http://www.travelport.com/schema/common_v33_0">Raza</HostToken>
  <TerminalCommand xmlns="http://www.travelport.com/schema/terminal_v33_0">*AB124</TerminalCommand>
</TerminalReq>
rxa092 commented 3 years ago

I removed the Host attribute from the HostToken element. The xml I got is below

<?xml version="1.0" encoding="utf-16"?>
<TerminalReq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TargetBranch="P3090173">
  <BillingPointOfSaleInfo OriginApplication="UAPI" xmlns="http://www.travelport.com/schema/common_v33_0" />
  <HostToken Key="123456" xmlns="http://www.travelport.com/schema/common_v33_0">Raza</HostToken>
  <TerminalCommand xmlns="http://www.travelport.com/schema/terminal_v33_0">*AB124</TerminalCommand>
</TerminalReq>

Now I get the exception Name is null

vivekjyotipramanik commented 3 years ago

Hi rxa092,

You have to first start the session, using CreateTerminalSessionReq/Rsp. Then in the response you will received the host token. You have to use that hosttoken in TerminalReq. Also, you have to have access to use Terminal via UAPI. To receive access, please reach out to your Travelport Account Manager. Please let me know how it goes. Thanks.