• Post Reply Bookmark Topic Watch Topic
  • New Topic

can't tell if it's posting--please help!!!  RSS feed

 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been having so much trouble with this, so please, any and all ideas are welcome! I have a Java file that POSTs to a JSP on my localhost machine like this:

Then on my listening JSP (specified in the saParams' 0th element above), I have this code:

On my listening page, I try printing out data to Tomcat's logs (System.out, etc), emailing it to myself, and writing it out to a file, but as far as I can tell, no POST is ever reaching that page! I know this, b/c I get emailed or a file gets written if I go to that page in a browser, but the rest of the time, when my notification code (at the top) is reached, I never get emailed from the listening page.
I know my notification code (at the top, when I'm writing out the XML string to a stream being POSTed to the URL) is reached b/c I email myself from within it. In both bits of code, I've emailed myself all sorts of relevant information, including any exceptions. However, I never hear of any problems, so I don't know what's going on! On the sending end, I've tried checking to see if the BufferedOutputStream is null, and I've found out that sXML.getBytes().length does return the correct value for the number of characters, so I don't know what else to check to make sure it's getting sent out! I've posted to forms with parameter values aplenty, but I've never posted a byte stream, so any insight would be greatly appreciated!

ONE LAST THING: I have figured out that the connect() method is timing out. What can I do about this? Why might it be happening? How do I try again? Thanks!
[ October 10, 2003: Message edited by: S. C. Huey ]
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never figured out why the java.net code wasn't posting, but I've gotten it to work with the Apache Commons HttpClient. Funny since in another place we use that same java.net code to post XML to another site. I wish Sun would stop playing with their servers so much and focus on Java even more. :roll:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!