I am using VB.NET programming language to access OPS. Has somebody here experience and can answer the following questions?
1. How to download PDF documents via OPS
When using the following code:
Code: Select all
Dim RestStr As String = "http://ops.epo.org/3.1/rest-services/published-data/images/EP/" & pn & "/" & ki & "/fullimage"
Dim WReq As WebRequest = WebRequest.Create(RestStr)
Try
Dim wResp As WebResponse = WReq.GetResponse
Dim sr = New IO.BinaryReader(wResp.GetResponseStream())
Dim bytes(wResp.ContentLength) As Byte
bytes = sr.ReadBytes(wResp.ContentLength)
wResp.Close()
Return bytes
Catch ex As System.Net.WebException
MsgBox(ex.Message)
End Try
"The remote server returned an error: (500) Internal Server Error."
The strange thing: sometimes it's working, but most often not. And: it is always working when I use the same URL manually in a web browser. I assume that I need to provide some properties to the WebRequest class of VB.NET?
2. How to pass on login credentials
How to pass on the OPS login credentials received from the EPO to the VB.NET objects above? Any idea?
Thanks a lot.
ksb