SOA-based system development is increasingly becoming an outline of distributed system development, and in the System inheritance platform project, we also have a good realization of this concept. In this project, the interaction between the various systems is mainly dependent on the webservice, which is the basic system for the examination system, the evaluation system to provide data support, and as the business continues to expand, we will provide more and more webservice, In this case, if the WebService WSDL is still held between the various systems to access the WebService in the later stage, it will cause serious maintenance problems, and consider inheriting the heterogeneous systems that were left behind. We finally chose to use an ESB to set up a WebService management center, All webservice are registered in the ESB Admin Center, and all clients hold all the unified interfaces that the ESB publishes externally, thus greatly improving the maintenance efficiency by decoupling the WebService server from the client. The most obvious benefit that the ESB brings to us is that when the address of our WebService WSDL changes, we do not have to make any effort to modify its own WSDL on each client that invokes the WebService, but only to change one place in the ESB's central administration. Let me introduce the functions of ESB for system integration through WebService Proxy.
Create a new mule Project first, and then open the. mflow file under the Flows folder, which can be configured in two ways, either through drag-and-drop process control or directly in XML. And the way the ESB publishes WebService is not one, and here we choose the simplest way. Look at the core configuration of the file:
<?xml version= "1.0" encoding= "UTF-8"?> <pattern:web-service-proxy name= " Weather-forecast-ws-proxy "inboundaddress=" Http://localhost:8082/WSServiceService "outboundaddress="/HTTP/ Localhost:8080/ychwebserviceserver/changshou "wsdllocation=" Http://localhost:8080/YCHWebServiceServer/changshou ? wsdl "/> </mule>
This is the simplest way to publish a WebService proxy, where inboundaddress is the broker port that the ESB publishes, Outblundaddress is the WebService address we actually publish, and then mule Application way to start this mule project, enter the Outboundaddress address in the browser, enter the proxy address of the ESB in a new window, and if both of them can successfully access WebService then our published ESB agent succeeds. Here the release WebService way I completely use in the previous blog "CXF WebService actual Combat" in the WebService, test client is also the test client in this article, the test code in this article will not repeat, By testing whether the real webservice address that we hold on the client or the WebService proxy address of the ESB can successfully complete the WebService call, we implement the system integration function through the ESB proxy.
Mule ESB implements WebService proxy