如何在sable SOAP API中使用c#创建会话资源

本文关键字:创建 会话 资源 sable SOAP API | 更新日期: 2023-09-27 17:57:47

//i希望使用soap为Sabre创建会话id或令牌号。我在里面发现了错误,我无法解决,如果有人解决了错误,可以告诉我

try
        {
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://webservices3.sabre.com");
            //HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://sws3-crt.cert.sabre.com/");

            req.UserAgent = Request.UserAgent.ToString();
            req.ContentType = "text/xml;charset='"utf-8'"";
            req.Accept = "text/xml";
            req.Method = "POST";
            req.Timeout = 500000;
            req.KeepAlive = false;
            req.ProtocolVersion = HttpVersion.Version11;

            Stream stm = req.GetRequestStream();
            doc.Save(stm);
            stm.Close();
            WebResponse resp  = req.GetResponse();
            stm = resp.GetResponseStream();
            StreamReader r = new StreamReader(stm);
            Response.Write(r.ReadToEnd());
            //Response.Write(stm.ToString());
            //Response.Write(r.ToString());
            Response.End();
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }

如何在sable SOAP API中使用c#创建会话资源

共享错误将有助于社区做出响应。不管怎样,您看过用于.NET的Sabre API代码示例(SACS)了吗?

https://github.com/SabreDevStudio/SACS-DotNet

它包括从SOAP生成会话的示例代码(如果您感兴趣,还包括REST)。