Web service and multiple requests from the same client

If I have a client application sending requests to my web service one by one, can the web service process every request made and not cancel the previous request due to a new request? I want all requests to be processed and not replaced with others. Will I be able to do this with several requests coming from the same client.

+3
source share
2 answers

The answer depends on your architecture.

For example, if the server is multithreaded, and part of the business logic does not have a state, then the requests on the server will not be redefined, since each thread calls the function and returns the result.

, , , , .

, .

: : http://weblogs.java.net/blog/2006/02/01/can-i-call-you-back-asynchronous-web-services

, , webservice. -, , , , .

, , , IP-. , , , , . , . , .

, , IP-: , oneway . , .

2: , :

@WebMethod
public ResponseModel[] AnswerQuestion(QuestionModel[] question) {
// Get the IP address of the client
  AnswerController ac = new AnswerController(question, ipaddress);
  return mypackage.myclass.StaticAnswers.GetAnswers(ipaddress);
  // return an array
}

@WebMethod
public ResponseModel[] GetAnswers() {
   return mypackage.myclass.StaticAnswers.GetAnswers(ipaddress);
}

, .

AnswerController . , , , , , const , , static.

StaticAnswers , - ipaddress .

.

, GetAnswers, . , .

, , , , - .

+1

, , , .

, - (, , ).

, , - , ( " " ", ).

+7

Source: https://habr.com/ru/post/1721351/


All Articles