I tried to follow stoicflame's code and notes, but I am not having any success getting a Profile response. I tried several different banks, but I am just getting 500 errors back. Does anybody have any idea what might be wrong with my code, which is in VB.net?
Dim OFXurl As String = "https://www.oasis.cfree.com/1401.ofxgp"
Dim Org As String = "US Bank"
Dim FID As String = "1401"
Dim userID As String = "anonymous00000000000000000000000"
Dim password As String = "anonymous00000000000000000000000"
Dim DataBuffer As New StringBuilder
DataBuffer.AppendLine("OFXHEADER:100")
DataBuffer.AppendLine("DATA:OFXSGML")
DataBuffer.AppendLine("VERSION:102")
DataBuffer.AppendLine("SECURITY:NONE")
DataBuffer.AppendLine("ENCODING:USASCII")
DataBuffer.AppendLine("CHARSET:1252")
DataBuffer.AppendLine("COMPRESSION:NONE")
DataBuffer.AppendLine("OLDFILEUID:NONE")
DataBuffer.AppendLine("NEWFILEUID:NONE")
DataBuffer.AppendLine()
DataBuffer.AppendLine("<OFX>")
DataBuffer.AppendLine("<SIGNONMSGSRQV1>")
DataBuffer.AppendLine("<SONRQ>")
DataBuffer.AppendLine("<DTCLIENT>" & Format(DateTime.Now, "yyyyMMddHHmmss"))
DataBuffer.AppendLine("<USERID>" & userID)
DataBuffer.AppendLine("<USERPASS>" & password)
DataBuffer.AppendLine("<LANGUAGE>ENG")
DataBuffer.AppendLine("<FI>")
DataBuffer.AppendLine("<ORG>" & Org)
DataBuffer.AppendLine("<FID>" & FID)
DataBuffer.AppendLine("</FI>")
DataBuffer.AppendLine("<APPID>QWIN")
DataBuffer.AppendLine("<APPVER>0900")
DataBuffer.AppendLine("</SONRQ>")
DataBuffer.AppendLine("</SIGNONMSGSRQV1>")
DataBuffer.AppendLine("<PROFMSGSRQV1>")
DataBuffer.AppendLine("<PROFTRNRQ>")
DataBuffer.AppendLine("<TRNUID>10001")
DataBuffer.AppendLine("<PROFRQ>")
DataBuffer.AppendLine("<CLIENTROUTING>NONE")
DataBuffer.AppendLine("<DTPROFUP>19600101120000")
DataBuffer.AppendLine("</PROFRQ>")
DataBuffer.AppendLine("</PROFTRNRQ>")
DataBuffer.AppendLine("</PROFMSGSRQV1>")
DataBuffer.AppendLine("</OFX>")
Dim byteBuffer() As Byte = Encoding.ASCII.GetBytes(DataBuffer.ToString)
Dim objReq As HttpWebRequest = WebRequest.Create(OFXurl)
objReq.Method = "POST"
objReq.ContentType = "application/x-ofx"
objReq.Accept = "*/*, application/x-ofx"
objReq.ContentLength = byteBuffer.Length
System.Net.ServicePointManager.Expect100Continue = False
Dim ReqStream As Stream = objReq.GetRequestStream
ReqStream.Write(byteBuffer, 0, byteBuffer.Length)
ReqStream.Close()
Dim objResponse As HttpWebResponse = objReq.GetResponse
Dim ResponseStream As Stream = objResponse.GetResponseStream
Dim responseReader As StreamReader = New StreamReader(ResponseStream)
Dim ResponseString As String = responseReader.ReadToEnd