Click here to Skip to main content
15,899,313 members

Comments by Sunil Thakur (Top 7 by date)

Sunil Thakur 18-Jan-16 14:09pm View    
Service reference for what purpose?
This is what i have tried for getting Quotes

string requestXml = '<getquotes><item><symbol>IBM<instrumenttype> Equity ';
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.trademonster.com/services/quotesService");
request.KeepAlive = false;
request.ProtocolVersion = HttpVersion.Version10;
request.ContentType = "application/xml";
request.Headers.Add("token", token); // This is the value of the token when we logged in.
request.Headers.Add("Set-Cookie", cookie); // cookies while logging in.
request.Method = "POST";
byte[] bytes;
bytes = System.Text.Encoding.UTF8.GetBytes(requestXml.ToString());

request.ContentLength = bytes.Length;

Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
requestStream.Close();
HttpWebResponse response;
response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK) // iam getting ok as response
{
Stream responseStream = response.GetResponseStream();
string responseStr = new StreamReader(responseStream).ReadToEnd(); // Here i am getting response with error user session does not exist
}
Sunil Thakur 18-Jan-16 12:44pm View    
I am using C# to implement that web service in my project.
Sunil Thakur 18-Jan-16 4:21am View    
Thanks Kornfeld,
Yes i do have registered. Iam able to login but unable to use the GetQuotes service. Any help would be appreciated
Sunil Thakur 6-Nov-15 9:07am View    
I have tried that also, i have done these things, add clientid also, but still im unable to get it.
Sunil Thakur 6-Nov-15 8:53am View    
Actually I am trying the to extract audio from url, but it displays error forbidden.

HttpWebRequest fileReq = (HttpWebRequest)HttpWebRequest.Create(url);
HttpWebResponse fileResp = (HttpWebResponse)fileReq.GetResponse();