Kuba Hejda
(Microservice architecture, Spring cloud basics, SOAP, WebServices)
Distributed/versioned configuration, Service registration and discovery, Routing, Service-to-service calls, Load balancing, Circuit Breakers, Global locks, Leadership election and cluster state, Distributed messaging
With so many clients and servers in play, it’s often helpful to include an API gateway in your cloud architecture.
A gateway can take care of securing and routing messages, hiding services, throttling load, and many other useful things.
Spring Cloud Gateway gives a precise control of the API layer, integrating Spring Cloud service discovery and client-side load-balancing solutions to simplify configuration and maintenance.
Many services need different configurations which cannot be stored inside cloud apps
The configuration has to be flexible enough to cope with multiple applications, environments, and service instances, as well as deal with dynamic changes without downtime
SpringCloudConfig offers solution to these problems, can serve config from the git or filesystem
Debugging distributed applications can be complex and take a long time.
For any given failure, you might need to piece together traces of information from several independent services.
Spring Cloud Sleuth can instrument applications in a predictable and repeatable way. And when used in conjunction with Zipkin, you can zero in on any latency problems you might have.
A set of standards for implementing web services:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<SOAP-ENV:Header>
...
...
</SOAP-ENV:Header>
<SOAP-ENV:Body>
...
...
<SOAP-ENV:Fault>
...
...
</SOAP-ENV:Fault>
...
</SOAP-ENV:Body>
</SOAP_ENV:Envelope><?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<m:GetPrice xmlns:m="http://www.w3schools.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope><?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope/"
soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>| Sub Element | Description |
|---|---|
| <faultcode> | A code for identifying the fault (VersionMismatch, MustUnderstand, Client, Server) |
| <faultstring> |
A human readable explanation of the fault |
| <faultactor> |
Information about who caused the fault to happen |
| <detail> |
used to carry application-specific error messages. The detail element can contain child elements called detail entries. |
| Error | Description |
|---|---|
| SOAP-ENV:VersionMismatch | Found an invalid namespace for the SOAP Envelope element. |
| SOAP-ENV:MustUnderstand | An immediate child element of the Header element, with the mustUnderstand attribute set to "1", was not understood. |
| SOAP-ENV:Client | The message was incorrectly formed or contained incorrect information. |
| SOAP-ENV:Server | There was a problem with the server, so the message could not proceed. |
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
<faultstring xsi:type="xsd:string">
Failed to locate method (ValidateCreditCard) in class
(examplesCreditCard) at /usr/local/ActivePerl-5.6/lib
/site_perl/5.6.0/SOAP/Lite.pm line 1555.
</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope><definitions name="HelloService"
targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
................................................
</definitions><types>
<xsd:schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<xsd:element name="TradePriceRequest">
<xsd:complexType>
<xsd:all>
<element name="tickerSymbol" type="string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://www.example.com/calculator"
schemaLocation="CalculatorService_schema1.xsd" />
</xsd:schema>
</types><message name="SayHelloRequest">
<part name="firstName" type="xsd:string"/>
</message>
<message name="SayHelloResponse">
<part name="greeting" type="xsd:string"/>
</message>
<wsdl:definitions .... >
<wsdl:portType .... > *
<wsdl:operation name="nmtoken">
<wsdl:input name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions><wsdl:definitions .... >
<wsdl:portType .... > *
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken" message="qname"/>*
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
<wsdl:definitions .... >
<wsdl:portType .... > *
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken" message="qname"/>*
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions><wsdl:definitions .... >
<wsdl:portType .... > *
<wsdl:operation name="nmtoken">
<wsdl:output name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions><binding type="glossaryTerms" name="b1">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation>
<soap:operation soapAction="http://example.com/getTerm"/>
<input><soap:body use="literal"/></input>
<output><soap:body use="literal"/></output>
</operation>
</binding><service name="Hello_Service">
<documentation>WSDL File for HelloService</documentation>
<port binding="tns:Hello_Binding" name="Hello_Port">
<soap:address
location="http://www.examples.com/SayHello/">
</port>
</service> <plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<executions>
<execution>
<id>schema-request-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateDirectory>${project.build.directory}/generated-sources/xjc-a</generateDirectory>
<generatePackage>cz.ares.request</generatePackage>
<schemas>
<schema>
<url>http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_request_rzp/v_1.0.4/ares_request_rzp_v_1.0.4.xsd</url>
</schema>
</schemas>
</configuration>
</execution>
<execution>
<id>schema-response-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generateDirectory>${project.build.directory}/generated-sources/xjc-b</generateDirectory>
<generatePackage>cz.ares.response</generatePackage>
<schemas>
<schema>
<url>http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_answer_rzp/v_1.0.5/ares_answer_rzp_v_1.0.5.xsd</url>
</schema>
</schemas>
</configuration>
</execution>
</executions>
<configuration>
<schemaLanguage>WSDL</schemaLanguage>
</configuration>
</plugin>