stringreader

Can not unmarshall the SOAP response

↘锁芯ラ 提交于 2019-11-28 01:43:25
问题 I could send a request and receive the response but I can not parse the response. It returns the following error: Local Name:Body error is here java.lang.NullPointerException at com.ticketmaster.ticketmaster.TicketMaster.Search(TicketMaster.java:119) at com.ticketmaster.ticketmaster.App.main(App.java:12) Code SOAPMessage response = connection.call(message, endpoint); connection.close(); SOAPMessage sm = response; SOAPBody sb = response.getSOAPBody(); System.err.println("Node Name:" + sb

Should I close a StringReader?

无人久伴 提交于 2019-11-27 23:31:18
I use a StringReader to turn a string into something I can upload to an SFTP server (it takes a stream). Is there any point in closing that StringReader afterwards? As far as I can see in the source it just sets the string to null ... I could just do it, but since the close method is marked as throwing an IOException and all I have to wrap it in a try catch and the code just ends up looking a lot more horrible than it perhaps needs to be. If you know you're dealing with a StringReader that you'll be throwing away, I don't see any reason to close it. I can't imagine any reason you'd be holding