private UniversalRecordRetrieveRsp GetUniversalRecord() { var res = GetAirAvailability(); UniversalRecordRetrieveRsp response = null; string someTraceId = "doesntmatter-8176"; string originApp = "UAPI"; UniversalRecordRetrieveReq req = new UniversalRecordRetrieveReq(); req.TraceId = someTraceId; req.AuthorizedBy = "user"; req.TargetBranch = "P7001182"; req.RetrieveProviderReservationDetails = true; ATPI.TWME.SP.Lib.URService.BillingPointOfSaleInfo billSetInfo = new ATPI.TWME.SP.Lib.URService.BillingPointOfSaleInfo(); billSetInfo.OriginApplication = originApp; UniversalRecordRetrieveReqProviderReservationInfo prov = new UniversalRecordRetrieveReqProviderReservationInfo(); prov.ProviderCode = "1G"; prov.ProviderLocatorCode = "7BC4N4"; //prov.ProviderLocatorCode = "C3829K"; req.BillingPointOfSaleInfo = billSetInfo; req.Item = prov; try { BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport); binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; string uri = "https://americas.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/UniversalRecordService"; EndpointAddress endpointAddress = new EndpointAddress(uri); UniversalRecordRetrieveServicePortTypeClient client = new UniversalRecordRetrieveServicePortTypeClient(binding, endpointAddress); if (client.ClientCredentials != null) { client.ClientCredentials.UserName.UserName = "******"; client.ClientCredentials.UserName.Password = "******"; } response = client.service(null, null, req); } catch (Exception ex) { throw ex; } return(response); }
public UniversalRecordRetrieveRsp UniversalRecordRetrieveRequest(string LocatorCode) { try { UniversalRecordRetrieveReq request = new UniversalRecordRetrieveReq(); UniversalRecordRetrieveRsp universalRecordRetrieveRsp = new UniversalRecordRetrieveRsp(); request.AuthorizedBy = "user"; request.TargetBranch = OFly.Utilities.CommonUtility.GetConfigValue(OFly.Utilities.ProjectConstants.G_TARGET_BRANCH); BillingPointOfSaleInfo billSaleInfo = new BillingPointOfSaleInfo(); billSaleInfo.OriginApplication = ConfigurationManager.AppSettings["OriginApplication"]; request.BillingPointOfSaleInfo = billSaleInfo; request.Item = LocatorCode; UniversalRecordRetrieveServicePortTypeClient client = new UniversalRecordRetrieveServicePortTypeClient("UniversalRecordRetrieveServicePort", OFly.Utilities.WsdlService.UNIVERSALRECORD_ENDPOINT); client.ClientCredentials.UserName.UserName = OFly.Utilities.Helper.RetrunUsername(); client.ClientCredentials.UserName.Password = OFly.Utilities.Helper.ReturnPassword(); var httpHeaders = OFly.Utilities.Helper.ReturnHttpHeader(); client.Endpoint.EndpointBehaviors.Add(new HttpHeadersEndpointBehavior(httpHeaders)); SupportedVersions supportedVersions = new SupportedVersions(); supportedVersions.airVersion = "air_v31_0"; supportedVersions.urVersion = "universal_v31_0"; universalRecordRetrieveRsp = client.service(supportedVersions, request); return universalRecordRetrieveRsp; } catch (Exception ex) { throw ex; } }