• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how acknowledge server with status code 200 , and continue request processing

 
varaprasad mutyala
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi frnds,

i have a problem that....

when i get a request from other server... i need to acknowledge with status code 200.

and then i need to continue the request processing....then i need to reply with hit back url (hitting back the server with resulted parameters)..

how is it possible to acknowledge.. process request in same servlet...

any help will be appreciated greatly...
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Code 200 is for informing the client that request is successfully processed, if you response 200 code before actually processing the request is NOT what you likely want to do.

And generally server handle the status code of the response, not the programmer.
Please look at the Status code 200 docs:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is that other server going to do with that status information anyway?

Bill
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
varaprasad mutyala wrote:when i get a request from other server... i need to acknowledge with status code 200.


You need to start by using the terms of art properly. A "server" is just a computer. In an HTTP request, one is the client and the other is a server.
The client makes a request, the server responds, perhaps with a 200.

At that point, that request is finished. nothing more can be done.

If you (the client) want, you can make another request, and as for something else. from the same server or from another server.

Once the 200 is sent by the server, nothing else can happen.
 
varaprasad mutyala
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well Pat Farrell

i will explain my problem clearly.....

there is a server called XYZ .....

all end users requests comes to this XYZ server..... after validating the user details... this XYZ server hit(HTTP Request with some request parameters) my

server ABC (The web application i am developing)...

then i need to acknowledge XYZ with status code 200 and then .. i need to process the request..

after processing by getting some parameters values i need to hit XYZ server .

for this i just need to send TransactioId what i got in XYZ request.(i need to hit XYZ with same paremeter to identify this transaction belongs to previous one)


Thank You
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still unclear to me, I think you want to do( or you should do )something like this:
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Editing, to what I think are what you mean
varaprasad mutyala wrote:there is a server called XYZ .....

all end users requests comes to this XYZ server..... after validating the user details... this XYZ server [makes a GET or POST to my server (ABC)] (HTTP Request with some request parameters) my server ABC (The web application i am developing)...

then i need to acknowledge XYZ with status code 200 and then .. i need to process the request..

after processing by getting some parameters values i need to hit XYZ server .

for this i just need to send [what? how?] TransactioId what i got in XYZ request.(i need to hit XYZ [no, do not use "hit" use the real verb, the real HTTP command] with same paremeter to identify this transaction belongs to previous one)


It seems to me that what you are trying to describe is:
  • * client browser talks to XYZ server
    * before XYZ returns anything to client, it calls your server ABC, so that to ABC, XYZ is the http client
    * You receive some sort of TransactionOID in the request from XYZ
    * you process the request
    * you include the TransactionOID in your response to XYZ
    * then XYZ does something and returns a response to the client browser


  • I could be wrong, I'm just trying to guess what you are actually trying to describe
     
    varaprasad mutyala
    Greenhorn
    Posts: 17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    well Pat Farrell ..

    you are correct...

    but here i need to do is.. when i got request in need to acknowledge with status code 200..

    and then i need to hit back(Http request to XYZ ) after processing request.
     
    Pat Farrell
    Rancher
    Posts: 4678
    7
    Linux Mac OS X VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    varaprasad mutyala wrote:but here i need to do is.. when i got request in need to acknowledge with status code 200..

    and then i need to hit back(Http request to XYZ ) after processing request.

    So what is the problem? You need a server/servlet that XYZ calls, you store the magic TransactionOID, and then after you reply to the initial request, you make a separate HTTP GET/POST to XYZ with your OID as a parameter.

    So write a servlet/bean and use the Apache HttpClient library to make the followup request.
     
    varaprasad mutyala
    Greenhorn
    Posts: 17
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank You Pat Farrell ..
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic