What exactly does this WSO2 ESB echo endpoint? - wso2

I am very new in WSO2 and I have the following doubt related to an ESB project on which I am working.
In this ESB application I am sending a message to a named endopoint mediator, something like this:
<send>
<endpoint key="echoEndpoint"/>
</send>
This is the contend of the related echoEndpoint.xml file in my project:
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="echoEndpoint" xmlns="http://ws.apache.org/ns/synapse">
<address format="soap11" statistics="enable" trace="enable" uri="http://localhost:8280/services/echo"/>
</endpoint>
So what exactly does this endpoint? The http://localhost:8280/services/echo is something like a predefined endopoined provided natively by WSO2? or what?

echo service included into esb/ei by default. You can see it in Carbon Panel -> Main -> Manage -> Services. There you can test it via "Try It" feature. It has few methods:
echoInt extected to get integer as argument and returned same integer value
echoString - expected to get string value as argument and returned same value
echoOMElement - received XML as argument and returned same XML
and some other methods. General idea - this service returned same value as it is received.
This service is helpful for testing purposes.

This is a service that by default is already displayed when you run the ESB. Echo.aar is located in the path repository\deployment\server\axis2services . And wsdl you can see https://localhost:your_Port/services/echo?wsdl

Related

Events are not visible on wso2 esb 5.0.0 analytics

I am trying to configure wso2 esb5.0.0 with esb analytics. I used default configs as given in the wso2 documentation. ESB is running on 9443 and esb analytics is running on 9444. I am invoking my test proxy but there is not entry in analytics dashboard. Below are the configs and proxy.
Synapse.properties
# Configuration to enable mediation flow analytics
mediation.flow.statistics.enable=true
mediation.flow.statistics.tracer.collect.payloads=true
mediation.flow.statistics.tracer.collect.properties=true
mediation.flow.statistics.event.consume.interval=1000
mediation.flow.statistics.event.clean.interval=15000
# Configuration to enable statistics globally irrespective of the individual artifact level setting
mediation.flow.statistics.collect.all=true
Proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="test"
startOnLoad="true"
statistics="enable"
trace="enable"
transports="http,https">
<target>
<inSequence>
<log level="full" separator="*****"/>
</inSequence>
<outSequence>
<respond/>
</outSequence>
</target>
<description/>
</proxy>
Can anyone help what I am missing?
You configured publishing analytics correctly and didn't miss anything. As analytics server retrieving data, you may have to wait around few minutes while publishing data.
And you can verify whether your events are publishing to analytics node via Data explorer in management console.
You have to navigate to management console (https://localhost:9444/carbon) and then to data explorer (Home > Manage > Interactive Analytics > Data Explorer). And check for table values.
Tested sample scenario as you indicated in the question and it works properly.

proxy Services in WSO2

How to develope a web service in WSO2 using proxy services ?
Applying my Oracle Service Bus knowledge here to create a proxy service which would take a string as an Input and return the same as response, I find it difficult in WSO2 to create a proxy service using my XML Schema.
I found that we can do the same in WSO2 using Custom proxy template.
But I am not sure of defining an Input and output in proxy service ;
In a traditional Oracle Service Bus we can do it by defining our XMl Schemas.
Seems like you need some echo kind of a service. This kind of behavior can be achieved by configuring the wso2 esb as in following manner. However this is not really a web service. I hope you are aware of what is web service and what does a proxy service does. But for your requirement you can try something like follows.
<proxy name="loopBackProxy" startonload="true" statistics="disable" trace="disable" transports="https,http" xmlns="http://ws.apache.org/ns/synapse">
<target>
<insequence>
<log level="full"></log>
<header action="remove" name="To"></header>
<property name="RESPONSE" value="true"></property>
<!-- your esb modifications here -->
<send></send>
</insequence>
</target>
<description></description>
</proxy>
This doesnot contains a outsequence, what this does is redirects the input to the client.

WSO2 indirect Endpoint inside Failover Group

Is it possible to use an Indirect Enpoint inside the definition of a Failover Group endpoint?
I mean something like this:
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="failOver2">
<failover>
<endpoint key="LBEndpoint" />
</failover>
</endpoint>
Where LBEndpoint is a load balance endpoint defined and saved previously in the registry.
When i click on the Save button... all my configuration is lost and the fail over group comes back into this form:
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="failOver2">
<failover/>
</endpoint>
Is this a bug? Inside the WSO2 ESB documentation it says that all this is possible.
Can you try editing synapse configuration directly? That is, not using sequence editor UI. Go to sourceview and manually edit and point the endpoint key in failoverendpoint.

WSO2 ESB send to multiple endpoints

Can a message be sent to multiple endpoints from within the send mediator in a proxy service?
This link from the WSO2 ESB Send Mediator documentation says under the Syntax chapter that If the message is to be sent to one or more endpoints, then the following is used:
<send>
(endpointref | endpoint)+
</send>
where the endpointref token refers to the following:
<endpoint key="name"/>
I've tried to include two endpoints under send, but the second one gets removed automatically when saving the proxy service (inside the Developer Studio or straight in the ESB Stratos interface). I did go to the Synapse page for the Send Mediator to see if they say anything special and their format says:
(endpointref | endpoint)?
Now assuming these characters represent regular expression, ? stands for 0 or 1 times, + is 1 or more times. Did WSO2 implement this extra "one or more endpoints" feature on top of Synapse Send Mediator or is it just a mistake on the documentation pages. If they did, what's the exact syntax to make it work?
Thank you!
Actually you can use Recipienlist endpoint to send a single message to multiple endpoints.
After defining recipient list store taht as localentry and provide that as endpoint key.
You can do something like this:
<send>
<endpoint key="jmsMBendpoint1"/>
</send>
<send>
<endpoint key="jmsMBendpoint2"/>
</send>
.I have used this approach and is working for me.
You can use the clone mediator to send to multiple endpoints with specifying respective endpoints as in the below configuration.
<sequence xmlns="http://ws.apache.org/ns/synapse" name="send_to_all">
<clone sequential="false">
<target endpoint="endpoint1"/>
<target endpoint="endpoint2"/>
<target endpoint="endpoint3"/>
</clone>
<drop/>
</sequence>

WSO2 soap12 endpoint to soap11 external service

I create a simple WSDL proxy in WSO2 to allow Soap 1.2 enabled applications to work with Soap 1.1 only external web service. Everything is fine except WSO2 doesn't transform soap11 replies back to soap12 when I send request via Soap12 WSO endpoint.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="MySOAP" transports="http"
statistics="disable" trace="disable" startOnLoad="true">
<target>
<endpoint>
<wsdl service="ExtService" port="ExtPort" uri="https://my.local/wsdl/current
/ExtService.wsdl"/>
<property name="DISABLE_CHUNKING" value="true" scope="axis2"/>
</endpoint>
</target>
<publishWSDL uri="file:///home/sysadmin/MySOAP.wsdl"/>
<description></description>
</proxy>
Has anybody faced anything similar? WSO2 ESB version 4.6.0
You need to add the format as following.
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11" />
</endpoint>
Format - The message format for the endpoint. The available values are:
[format="soap11|soap12|pox|get"]
Leave As-Is - No transformation is done to the outgoing message.
SOAP 1.1 - Transforming message to SOAP 1.1.
SOAP 1.2 - Transforming message to SOAP 1.2.
Plain Old XML (POX) - Transforming to plain old XML format
Representational State Transfer (REST) - Transforming to HTTP Get
Request
GET
http://docs.wso2.org/wiki/display/ESB460/Default+Endpoint
This has been an issue for a while now. See jira https://wso2.org/jira/browse/ESBJAVA-1994.
If you don't want to manually transform your response from the backend, uncomment the relevant NHTTP transport entries in axis2.xml and comment out the HTTP PassThrough transport entries.