简体   繁体   English

按电话号码搜索旅客资料

[英]Search Traveler Profile by Phone Number

I am trying to retrieve all profiles associated with a specific phone number.我正在尝试检索与特定电话号码关联的所有配置文件。 I have pulled all of the phone numbers I'm testing with directly from Sabre.我已经直接从 Sabre 那里提取了我正在测试的所有电话号码。 When I used a number associated with multiple profiles, the search correctly returns multiple profiles.当我使用与多个配置文件关联的数字时,搜索会正确返回多个配置文件。 If I use a phone number associated with just one profile, I receive the message 'No profiles match'.如果我使用仅与一个配置文件关联的电话号码,我会收到消息“没有配置文件匹配”。 Is there anything that could be causing this?有什么可能导致这种情况吗? Do I need to be setting a flag or something on the Telephone field?我是否需要在电话字段上设置标志或其他内容?

Search Profile Request搜索配置文件请求

<Sabre_OTA_ProfileSearchRQ Version="6.61.4" xmlns="http://www.sabre.com/eps/schemas">
      <ProfileSearchCriteria ProfileNameOnly="N" PageNumber="1" ReturnCount="250">
        <TPA_Identity DomainID="*" ProfileTypeCode="TVL" ClientCode="TN" ClientContextCode="TMP" />
        <Telephone>
          <FullPhoneNumber>555-555-5555</FullPhoneNumber>
        </Telephone>
      </ProfileSearchCriteria>

Search Profile Response搜索配置文件响应

<Sabre_OTA_ProfileSearchRS xmlns="http://www.sabre.com/eps/schemas" TimeStamp="2022-08-24T20:09:20.327Z" Version="6.74">
      <ResponseMessage>
        <Success />
      </ResponseMessage>
      <ProfileInfo>
        <Message>No profiles are found which match your selection criteria</Message>
      </ProfileInfo>
    </Sabre_OTA_ProfileSearchRS>

If you xml has multiple profiles I would recommend using a dictionary along with xml linq.如果您 xml 有多个配置文件,我建议您使用字典和 xml linq。 Xml has a default namespace that you have to use in the search. Xml 有一个您必须在搜索中使用的默认命名空间。

using System;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
using System.Xml.Linq;

namespace ConsoleApp2
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {

            XDocument doc = XDocument.Load(FILENAME);
            XNamespace ns = doc.Root.GetDefaultNamespace();

            Dictionary<string, XElement> dict = doc.Descendants(ns + "ProfileSearchCriteria")
                .GroupBy(x => (string)x.Descendants(ns + "FullPhoneNumber").FirstOrDefault(), y => y)
                .ToDictionary(x => x.Key, y => y.FirstOrDefault());

        }

    }
   
}
 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 军刀资料搜索-使用EPS_ProfileSearchService收集与给定公司资料相关的所有旅行者资料 - Sabre Profile Search - using EPS_ProfileSearchService to gather all Traveler Profiles Associated with a Given Corporate Profile 如何在MongoDB中搜索各种电话号码格式? - How to search MongoDB for various phone number formats? 按个人资料属性搜索用户 - Search user by profile property ASP.NET MVC 5.1 C#OWIN facebook身份验证或登录请求生日,喜欢,公开个人资料,电话号码 - ASP.NET MVC 5.1 C# OWIN facebook authentication or login ask for birthday, likes, public profile, phone number 从Lotus Traveler获取日历 - Getting Calendar from Lotus Traveler 如何使用不带掩码的电话号码从访问数据库中搜索数据 - How search data from access database using phone number that without masked 如何在mssql中搜索可以以不同格式存储的字符串(电话号码) - How to search a string(Phone number) which can be stored in different format in mssql Windows Phone 8中的SSDP搜索 - SSDP Search in Windows Phone 8 使用实体框架如何搜索电话号码而忽略空格? - Using Entity Framework how can I do a search on phone number ignoring spaces? 设置电话号码 - Get Set for a phone number
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM