Hi,
First the goal:
1.First request - Login to Live Link 9.5 programaticaly from .net application using httpWebRequest POST method
2.Second request - Retreieve xml using objAction=XMLEXport parameter
VB.NET code looking something like this:
==============
Dim newUri As New Uri(url)
Dim result As String = ""
Dim nexturl As String = Server.UrlEncode("Dim encoding As System.Text.ASCIIEncoding = New System.Text.ASCIIEncoding()
Dim strPost As String = "func=ll.login&Username=username&Password=password&nextURL=" & nexturl
Dim data As Byte() = encoding.GetBytes(strPost)
Dim myWriter As StreamWriter = Nothing
Dim objRequest As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
objRequest.Method = "POST"
objRequest.ContentType = "application/x-objRequest.ContentLength = strPost.Length
Dim newStream As Stream = objRequest.GetRequestStream()
' Send the data.
newStream.Write(data, 0, data.Length)
newStream.Close()
objRequest.CookieContainer = cookCont
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
==============
The problem is the as a result I get html:
<HTML>
<!-- File: redirectmeta.html -->
<HEAD>
<TITLE>Livelink - Redirection</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://server/instance/livelink.exe?func=ll&objId=2000&objAction=XMLEXport">
</HEAD>
</HTML>
<!-- End File: redirectmeta.html -->
However, at this point I am already supposed to be logged in, in order to send second request and I am not
If it helps: My application currently running from localhost and submits to web server where LL is installed
I've checked similar threads, but it seems like no one posted a real solution to this
Thanks for your help
First the goal:
1.First request - Login to Live Link 9.5 programaticaly from .net application using httpWebRequest POST method
2.Second request - Retreieve xml using objAction=XMLEXport parameter
VB.NET code looking something like this:
==============
Dim newUri As New Uri(url)
Dim result As String = ""
Dim nexturl As String = Server.UrlEncode("Dim encoding As System.Text.ASCIIEncoding = New System.Text.ASCIIEncoding()
Dim strPost As String = "func=ll.login&Username=username&Password=password&nextURL=" & nexturl
Dim data As Byte() = encoding.GetBytes(strPost)
Dim myWriter As StreamWriter = Nothing
Dim objRequest As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
objRequest.Method = "POST"
objRequest.ContentType = "application/x-objRequest.ContentLength = strPost.Length
Dim newStream As Stream = objRequest.GetRequestStream()
' Send the data.
newStream.Write(data, 0, data.Length)
newStream.Close()
objRequest.CookieContainer = cookCont
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
==============
The problem is the as a result I get html:
<HTML>
<!-- File: redirectmeta.html -->
<HEAD>
<TITLE>Livelink - Redirection</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://server/instance/livelink.exe?func=ll&objId=2000&objAction=XMLEXport">
</HEAD>
</HTML>
<!-- End File: redirectmeta.html -->
However, at this point I am already supposed to be logged in, in order to send second request and I am not
If it helps: My application currently running from localhost and submits to web server where LL is installed
I've checked similar threads, but it seems like no one posted a real solution to this
Thanks for your help