Get Answers!
   

chillnoor

How To Set Http Request Headers In Java Class ?

Friday, 17th April 2009

I created a httpRedirector class, it gets the request and sends that to actual host and get the response, send to the requester client(java class). <br>Description: <br>============ <br>1. httpdirector listens the port, say 8080 <br>On the port 8084, one service is running as background process (like apache tomcat service). <br>2. Now the requester client (java class) has some sends the requesting url as hardcoded string, but the parameters are set by NameValuePair. The, sends it by using PostMethod. Eg:- request to create a message in that service which runs in 8084, through the httpRedirector. So i request to 8080 only. <br>3. The problem is, <br>If i pass the xml based message, in the hardcoded url means, it is created in that service thru my httpredirector. <br> <br>http://localhost:8080/demo?type=message&amp;destination=myMsg&amp;body=&lt;root&gt;&lt;data&gt;My test message&lt;/data&gt;&lt;/root&gt; <br> <br>but not created by the following, <br> <br>http://localhost:8080/demo?type=message&amp;destination=myMsg&amp;body=&lt;?xml version=\&quot;1.0\&quot;?&gt;&lt;root&gt;&lt;data&gt;My test message&lt;/data&gt;&lt;/root&gt; <br> <br>also, if sets the parameter by namevaluepair means, <br>http://localhost:8080/demo? <br>NameValuPair paramter settings are, <br>type=message <br>destination=myMsg <br>body=&lt;?xml version=\&quot;1.0\&quot;?&gt;&lt;root&gt;&lt;data&gt;My test message&lt;/data&gt;&lt;/root&gt; <br> <br>so in these conditions it gives error as, <br> <br>java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read <br> <br>So anyone, please help to resolve this problem. <br>Thanks in advance
 





More Programming:
» How Do I Get The Length Of A String In JavaScript?
» Need To Know How To Make A Java Program To Put Mecical Records For My Java Class
» How Can I Add A Timer To My Site That Does A Countdown That I Can Specify The Starting Point For?
» How Do I Upload A Sitemap.xml File To My Google Site? What Program Do I Use To Do It?
» I Am Doing PHP Mysql But I Dont Know Any Programming Language Kindly Advice I Already Paid For That Course
» How Do I Hyperlink My Table Td Cell?
» How Can I Increase The Time For My Sessions To Remain Active With PHP?
» Where Is My Php.ini File?


Leave a Comment on "How To Set Http Request Headers In Java Class ?"
You must be logged in to post a comment.


Link to This Question!