Designing a web service integration

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 .





, , :

  1. - , - . , , :)





  2. / (. Endpoints PROD, QA / TEST). - . , , . , β€œapi”. , - .





    Here the Youtube search web service gave an error, because it expected that in the request we will pass the API key (issued on their website, individual for each)
    - Youtube , , API ( , )
  3. . -, ? : API, , , .





  4. WSDL, SOAP -. -: SOAP REST, . REST , SOAP , (XSD – XML Schema Definition). , WSDL, – SOAP , WSDL. WSDL , . SOAP - , SOAP UI. SOAP .XML , REST - .JSON, .XML, .TXT





  5. : - , ? ?





    Swagger Request
    Swagger
  6. . REST, Swagger ( SwaggerUI). - , - , , PROD QA.





    Swagger's answer
    Swagger
  7. ? , , , , . , .





  8. ( ) . , . : - , , - , , , . , . , , 99 , / .





  9. : , .





    1. . , , . : β€œ2007”, 2007 , Date β€œ2007-01-01” DateTime β€œ2007-01-01 11:00:00”. , , /, , () .





    2. – , , , . , , , , , -, . SOAP WSDL , <! -- Optional: -->. REST Swagger, .





      SOAP UI
      SOAP UI
      Swagger
      Swagger
    3. – , , . SOAP WSDL / , minLenght / maxLength. REST , . , (, , ), .





  10. (. exception flow). , , : 20 , 10 , .





  11. , / ( , ). , : .





  12. PROD / QA , . , QA – . - - , , , . .





  13. . , / , .





  14. . : , , .





    interface for viewing Kibana logs
    Kibana
  15. . , , , , . , .





2. , :

  1. . β€œ ” , : , .





  2. . , , / .





  3. -. : ( ), 20 100 . , / / , . .





  4. ? , β€œstrategy”, . .





  5. . -, , , . , .





3. , !

  1. . , . .





  2. . , 200 OK ( ). : , 200 OK, 201 Created.





  3. 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.





    Most popular HTTP status codes
    Most popular HTTP status codes

Thanks for attention! Share your cases in the comments.



Kirill Mark, Tinkoff

@mar_kirr








All Articles