I am trying to create session using SessionCreateRQ soap service. which is first step of using sabre soap services where I have created object of HttpWebRequest with end point https://sws3-crt.cert.sabre.com and passing the request xml copied from sabre documentation to create a session
public HttpWebRequest CreateWebRequest()
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(@"https://sws3-crt.cert.sabre.com");
webRequest.Headers.Add(@"SOAP:Action");
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
return webRequest;
}
public void Execute()
{
HttpWebRequest request = CreateWebRequest();
XmlDocument soapEnvelopeXml = new XmlDocument();
soapEnvelopeXml.LoadXml(@"<?xml version=""1.0"" encoding=""UTF-8""?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:eb=""http://www.ebxml.org/namespaces/messageHeader"" xmlns:xlink=""http://www.w3.org/1999/xlink"" xmlns:xsd=""http://www.w3.org/1999/XMLSchema"">
<SOAP-ENV:Header>
<eb:MessageHeader SOAP-ENV:mustUnderstand=""1"" eb:version=""1.0"">
<eb:ConversationId/>
<eb:From>
<eb:PartyId type=""urn:x12.org:IO5:01"">999999</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId type=""urn:x12.org:IO5:01"">123123</eb:PartyId>
</eb:To>
<eb:CPAId>IPCC</eb:CPAId>
<eb:Service eb:type=""OTA"">SessionCreateRQ</eb:Service>
<eb:Action>SessionCreateRQ</eb:Action>
<eb:MessageData>
<eb:MessageId>1000</eb:MessageId>
<eb:Timestamp>2016-03-09T11:15:12Z</eb:Timestamp>
<eb:TimeToLive>2016-03-10T11:15:12Z</eb:TimeToLive>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse=""http://schemas.xmlsoap.org/ws/2002/12/secext"" xmlns:wsu=""http://schemas.xmlsoap.org/ws/2002/12/utility"">
<wsse:UsernameToken>
<wsse:Username>myUserName</wsse:Username>
<wsse:Password>myPasswordenter code here</wsse:Password>
<Organization>IPCC</Organization>
<Domain>DEFAULT</Domain>
</wsse:UsernameToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<eb:Manifest SOAP-ENV:mustUnderstand=""1"" eb:version=""1.0"">
<eb:Reference xmlns:xlink=""http://www.w3.org/1999/xlink"" xlink:href=""cid:rootelement"" xlink:type=""simple""/>
</eb:Manifest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>");
using (Stream stream = request.GetRequestStream())
{
soapEnvelopeXml.Save(stream);
}
using (WebResponse response = request.GetResponse())
{
using (StreamReader rd = new StreamReader(response.GetResponseStream()))
{
string soapResult = rd.ReadToEnd();
Console.WriteLine(soapResult);
}
}
}
but getting 500 error code on request.GetResponse(). Is there any problem with code or end point is wrong if its wrong please provide correct one.