I'm looking for suggestions on how to implement something for a website I'm trying to create.
There are some internally hosted SOAP services I want to consume, but I want to know what the best way of doing it is, the kicker is that certain elements from the response are required in the next request. I could (and have done previously) managed this but it wasn't very clean or clear.
I've spoken to some colleagues and I've had the Chain of Responsibility (CoR) design pattern mentioned but I'm not 100% sure if this is exactly what I need, and if it is I can't seem to visualise how this would work in my head given my current and limited understanding of it.
The flow will go something like this:
User fills out a form which posts data items FirstName, LastName, DOB, Postcode
Service1 is then called with the above details in the request body
Service1 responds with some other data, EG
<CustomerId>99999</CustomerId>
Service2 then needs to be constructed with a body which itself requires the CustomerId node and others.
My understanding of the CoR is that it will pass the request on until it can find something to handle it, I'm trying to understand if this is the correct pattern to use of if I need to use something else?
I am also assuming best practice is to map the items I receive back in my service calls into objects as well?
Aucun commentaire:
Enregistrer un commentaire