CLRObject object not initialized

I’m using the System.Net.WebResponse object within X++. I’m receiving a CLRObject object not initialized when trying to call the GetResponseStream() method. Here is the code:

System.Net.WebReponse getResponse;

System.IO.Stream readStream;


readstream = getResponse.GetResponseStream();

Any help would be appreciated.


That probably means that getResponse is null (its initialization is not shown in your snippet so I can’t comment it).

That is the code that I have. What needs to be done to initialize it?

You should the response from a web request.