H Paul wrote:To debug, I would do different ways:
0. Change catch (IOException e) to catch (Exception e) and run the test. Look at server log as well.
1. Use TCP/IP mon that you can download and watch for the request sent to the server
and the response sent back to the client.
2. Without using the code, Use Restclient from Firefox brower, send a POST and xml request body.
OR use SOAP UI
Good luck.
Thanks for your reply. No Exceptions were thrown even with Exception instead of IOException.
I finally got everything working. The reason Intellij was putting up a Invalid format RESPONSE was that
the REST method was expecting a Stream and I was just sending it nothing from the REST POST test.
Intellij was correct. In any case, that error let me know things were getting close.
I was getting a 201 (HTTP "Created") in my client test code, so it was really confusing why nothing was happening....
This other problem was that the URL test code above was not connecting for some reason to the server REST logic.
I created the log4j setup to try see what was going on, but no log entries were being created. The problem there turned out
to be that I was running the test code too many times and the URL wasn't reachable.
Once I closed down each test program each time, it worked like a charm.
A few little tweaks here and there (like removing the spaces from readCustomer() fields read from the DOM), but otherwise, it works ... finally.
Test code works and Log4j is spitting out log entries like crazy!
Thanks very much for your reply.
-mike