More and more analysts, projects and products are coming to IT from marketing, consulting, sales and other non-tech industries, and with no work experience at all. And I was no exception here. There is a problem that in the first years you get a lot of technical terms and concepts, you try to figure them out, but you donβt understand to what level of detail you need to go down in each of them. Do you need to figure out what the term WSDL you discovered means and what types of asynchronous request execution are, or is it enough to know that a web service simply has a request and a response? The article is needed to solve this problem for one of the most common features - learning how to work with a web service for exchanging data, performing targeted actions in other systems and other integrations.
There is a lot of material in Russian and English about why web services are needed, what they are, how to design them, there are cool cases. But about how to interact with them in practice, especially on complex corporate systems, I did not find anything comprehensive. And as experience shows, the devil is in the details and subparagraphs, most of those described in this article are my own "bumps".
, : -, , . 20 . , , 20 100 ., , 100 ., . , ! , 15 , , 8 .
, , :
- , - . , , :)
/ (. Endpoints PROD, QA / TEST). - . , , . , βapiβ. , - .
. -, ? : API, , , .
WSDL, SOAP -. -: SOAP REST, . REST , SOAP , (XSD β XML Schema Definition). , WSDL, β SOAP , WSDL. WSDL , . SOAP - , SOAP UI. SOAP .XML , REST - .JSON, .XML, .TXT
: - , ? ?
. REST, Swagger ( SwaggerUI). - , - , , PROD QA.
? , , , , . , .
( ) . , . : - , , - , , , . , . , , 99 , / .
: , .
. , , . : β2007β, 2007 , Date β2007-01-01β DateTime β2007-01-01 11:00:00β. , , /, , () .
β , , , . , , , , , -, . SOAP WSDL , <! -- Optional: -->. REST Swagger, .
β , , . SOAP WSDL / , minLenght / maxLength. REST , . , (, , ), .
(. exception flow). , , : 20 , 10 , .
, / ( , ). , : .
PROD / QA , . , QA β . - - , , , . .
. , / , .
. : , , .
. , , , , . , .
2. , :
. β β , : , .
. , , / .
-. : ( ), 20 100 . , / / , . .
? , βstrategyβ, . .
. -, , , . , .
3. , !
-
. , 200 OK ( ). : , 200 OK, 201 Created.
Synchronous / Asynchronous request execution. When a request is executed synchronously, it is processed immediately upon receipt. With asynchronous communication, requests are queued on the service side and the target action is not immediately executed. From the owners or users of the service, you can find out how much, on average, an event is in the queue and how much more time it takes to process the request. Success codes 201 and 202 hint at asynchrony. If you received them, it is better to check that the target action will be fulfilled.
Thanks for attention! Share your cases in the comments.
Kirill Mark, Tinkoff
@mar_kirr