-2

// i want create session id or token number for Sabre with soap. i find error in it, and i am unable to solve it, if any one solve the error can tell me

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);
        }

1 Answers1

0

Sharing the error will help the community to respond. Anyway, have you looked at the Sabre API Code Samples (SACS) for .NET?

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

It includes sample code to generate a session from SOAP (and also REST if you are interested).

fcarreno
  • 701
  • 4
  • 8