In the previous article, we wrote a message broker, followed by a proxy service.
Proxy Service
As the name implies,The proxy service acts as the proxy for the wso2 ESB service. It is usually an existing service endpoint. The proxy service can use different transmission modes.
Customers canDirectSendRequestProxy ServiceESB,Customer seesService Proxy.
Running example
ConfigurationWso2 ESB
Log on to https: // localhost: 9443/carbon
ClickWeb Services> List
You will seeDefined,NoProxy Service.
Click on the leftWeb Services> Add> proxy service
You will seeOneStandard proxyServiceTemplateSelect from the list.
From listMediumSelectCustom proxyTemplate custom proxy
Enter the proxy name "stockquoteproxy"
Next step,We willSpecifyThis proxyService..Can it be used? WSDL displayActual ServiceUseWSDL operation. Under general settings, select 'specify source url'
You will be prompted to enter the WSDL path and the path to the tested WSDL file is file :~ /Java/wso2esb-4.0.2/Repository/samples/resources/Proxy/sample_proxy_1.wsdl
Click test URI to perform the test. The test is successful, as shown in figure.
Next, select You Public Of Proxy Service Service . by default, proxy service , use HTTP and HTTPS transmission >. You can also Add proxy service service parameters . On ESB starting , it starts all proxy service , and required proxy service join WSDL . If ESB statup cannot be found WSDL , it ignores Such service , and continue Start .
Then click Next,AsNext step of the wizard,WeAddTarget endpointProcessingSequenceProcessingRequest MessageRequest MessageAnd goals.
Select define endpoint
Create, selectAddress endpoint.
Enter http: // localhost: 9000/services/simplestockquoteservice
Test
Click Save to save
Next, select define out sequenceDefine inlineCreate
Save
Then finish
NowServiceList page,YouWill be ableSee the newly createdOfProxy Service.
PassClickCorresponding icon,EnableProxy ServiceOfStatisticsAndTracking.
Then start the axis2 Service
After startup is complete
Go to the <ESB-Home>/samples/axis2clients directory
Ant stockquote-dtrpurl = http: // localhost: 8280/services/stockquoteproxy-dmode = quote-dsymbol = IBM
You can get
Standard: stock price = $165.32687331383468
Then clickMonitor> mediation statistics
ClickProxy service statistics
The statistical result is displayed.