Regards
V F Pinto
Ulf Dittmer wrote:I'm not quite sure what you're asking, or rather, I don't see the connection between handling a CSV file and a REST WS call. The WS si just server-side Java code - it can do anything any other Java code can do, including handling CSV files in whichever way you can imagine. But what do you mean by "passing the input stream from a CSV file"? Is the CSV file on the client? If so, you need to send its data as part of the WS call if the server needs to process it, an InputStream is not something you can pass between client and server.
Regards
V F Pinto
Regards
V F Pinto
Ulf Dittmer wrote:OK, you're getting an NPE. But the code does not show how you're obtaining the connection, so we can't speculate what might be going wrong.
And if that's the problem, please clarify how that block of code relates to the WS call (see my previous post).
Regards
V F Pinto
Ulf Dittmer wrote:So there's a NPE in the line that contains "connection.getOutputStream()"? That's quite odd, as connection can't be null - several methods are invoked on it before that line. Please post the entire stack trace.
You should not close the OutputStreamWriter where you're doing that now, as closing it will close the underlying connection - close it when you're done reading as well.
Regards
V F Pinto
i don't know you are able to follow the problem?
Regards
V F Pinto
Ulf Dittmer wrote:"null" is not the same as no data; please be precise about what's happening, we have only what you write to go by.
Are we still talking about the last code you posted? That looks a bit different - it couldn't have produced the exact output you posted just now. Printing either "wr.toString()" or "connection.getOutputStream()" is not particularly useful - what do you think those should print?
Given what is printed after that ("sb.toString..."), do you have reason to believe that something is going wrong? It looks OK to me.
Regards
V F Pinto
Consider Paul's rocket mass heater. |