Forum Moderators: DixonJones
Still not working though, and my distributor don't have any samples.
So: anyone out there who has a (simple) working example of accessing IndexTools through the API ? Preferably in Visual Studio C#, but I'll be happy with pretty much anything.
BTW - this is what I have done (sans the usernames / passwords), in case anyone should be interested:
string data =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"> " +
" " +
" <soapenv:Body> " +
" <Login xmlns=\"http://v3.soap.api.indextools.com\"> " +
" <PartnerId>#*$!XX</PartnerId> " +
" <PartnerPassword>YYYYYY</PartnerPassword> " +
" <UserId>ZZZZZ</UserId> " +
" <UserPassword>QQQQQ</UserPassword> " +
" <secure>true</secure> " +
" </Login> " +
" </soapenv:Body> ";
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(URI);
request.Method = WebRequestMethods.Http.Post;
request.ContentLength = data.Length;
request.ContentType = "application/x-www-form-urlencoded";
StreamWriter writer = new StreamWriter(request.GetRequestStream());
writer.Write(data);
writer.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string tmp = reader.ReadToEnd();
response.Close();
label1.Text = tmp;