How to create a transport in wso2 - esb developer studio - wso2

When using wso2 developer studio to create a scenario in wso2 - esb, how do we create a transport from the UI ? I found that we can define the transport in the proxy service in text, but how to configure the properties of a transport within the UI ? Or is the inboundEndpoits the only method we can define a message in-point within the dev-studio.

You can add transport from the property view.
Right click on the proxy -> show propertties view
There is a property called transports under Basic. You can select transports from there
Hope this answers the question!

Related

WSS Support in WSO2 API Manager

I am verifying the Websocket support in WSO2 API manager for one of my requirement. By default, WSO2 API Manager provides the options for configuring "WS" protocol and able to access it. But I couldn't find any configuration for "WSS" protocol support.
Is there any limitation in WSO2 API manager or is there any documentation available?
Thanks,
Sow
WebSocket support is available by default in WSO2 API Manager. Related transport configurations should be available inside the axis2.xml configuration file. You can find related documentation in the WSO2 API Manager documentation.
https://docs.wso2.com/display/AM260/Create+a+WebSocket+API
When using wss endpoint, we were able to observe some errors and we were able to get rid of the errors with the following approach.
Please include the following parameter in the SecureWebSocketInboundEndpoint.xml file which resides in the <APIM_HOME>/repository/deployment/server/synapse-configs/default/inbound-endpoints directory.
TLSv1.1,TLSv1.2
Also, please remove the following parameters from the same SecureWebSocketInboundEndpoint.xml file if the following parameters(wss.ssl.trust.store.file and wss.ssl.trust.store.pass) exist in the file.
repository/resources/security/client-truststore.jks
wso2carbon
Please use the following sample web socket client to try out and run the WSS client. Please change the variable carbonKeyStoreLocation to point to <API-M_HOME>/repository/resources/security/wso2carbon.jks. Note that port for the WSS API is 8099.
You can download the WSS client in the following WSO2 official documentation under the WSS Support section. (In the second step.)[1] Further please change the access token, web socket endpoint and the carbonKeyStoreLocation with your one to try out the scenario.
[1] https://docs.wso2.com/display/AM260/Create+a+WebSocket+API

Custom message builder to handle binary data - wso2 EI

1) I have an incoming message from IBM Legacy system, i need to convert it into XML/text and send it back to a client using WSO2 EI 6.1.1.
2) I am using apache kafka as a messaging queue here, hence i have created an inbound endpoint in wso2 EI.
3) I believe WSO2 EI by default doesn't have a binary builder, so i have written a custom message builder and added that JAR in EI_HOME/lib and added the message builder class in axis2.xml
4) I posted the binary message in to kafka topic, but still wso2 EI is not able to convert into desired format.
5) The message builder (logic) is working as a standalone java function and i can get expected response.
Any help to solve this issue would be appreciated.
Thanks
The content-type given in axis2.xml should match the content type given in kafka inbound endpoint.
the class path should be added in axis2.xml

Changing WSO2 / Synapse to expose CXF service instead of AXIS2

Currently WSO2/Synapse uses AXIS 2 services as a base and proxy service tag exposes a typical service based on AXIS 2 engine.
Is it possible to change this to expose CXF service instead? If it's not currently supported out of box, can you give an idea of how large that effort would be if I am ready to make those changes myself in WSO2/Synapse
Thanks,
Harish
CXF based inbound endpoint implementation will be release with the next ESB(4.9.0) version. This feature is primarily for CXF reliable message support. If you need to write your own custom inbound endpoint on the CXF, you can check the existing ESB 4.9.0 code base;
https://github.com/wso2/carbon-mediation/tree/master/components/inbound-endpoints/org.wso2.carbon.inbound.endpoint.ext.wsrm

Error message in wso2 dss

I'm using wso2 esb4.7.0 and wso2 dss 3.1.0.I have created a dataservice in dss and tested using try this service tool.It's working fine but when same dataservice is being fetch in esb using it's adress endpoint it showing following error -
ERROR {org.wso2.carbon.statistics.internal.ResponseTimeCalculator} - wso2statistics.request.received.time is null in the IN MessageContext
why so?is their any problem with esb?or it's internal problem?please let me know..
You have to set message headers using Header mediator. At least you have to set "To" and "Action" headers before you send payload to the data service. To get the write value of To and Action headers you can use Soap Tracer tool in monitor tab of WSO2-DSS management console. Run the tool, try the data service and refresh the tool to see the results of your trying. In the left side of the page of Soap Tracer tool you will see the To and Action, copy values from there and put them in header mediators you are using.

Getting WSO2 ESB endpoint meta data programmatically

I am trying to programmatically retrieve the meta data of the end points configured to WSO2 ESB (Eg: ServiceName, WebMethods, Input/Output Parameters with Return types etc). Can someone direct me to some way/docs which could help me fetch this data.
Unfortunately it's not really clear what you want to do. Here some examples how to access properties (Meta-Data?)
inside a proxy/sequence access properties:
<property name="some name" expression="get-property('registry','conf:resource/path')"/>
<property name="some name" expression="get-property('registry',gov:resource/path')"/>
<property name="some name" expression="get-property('registry','resourceName')"/>
Or inside a Custom Mediator:
String property = (String)messageContext.getProperty("nameOfThePropery");
Or inside a Custom Mediator (getting the filename from the Transport Layer):
org.apache.axis2.context.MessageContext axis2messageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext();
// print the filename of the current transport
myLog.info("FileName: " + axis2messageContext.getTransportIn().getName());
Hope this helps you a little bit further, otherwise improve you question.
To further improve on Abdul's question, we are developing a web-service gateway between a legacy client on side and on the other side are external web-services. We have created a template/sequences in WSo2 where we trap the legacy client request and redirect it to the correct web-service based on a internal protocol.
The external web services are registered in WSo2 as endpoints. So far we have been configuring these endpoints manually using the admin console. We are looking at automating this step so that our gateway will hit WSo2 and provide the WSDL URL. A class mediator would then invoke the WSo2 / Synapse APIs to save this endpoint in the Synapse configuration. We have not been successful in this.
We have also read the docs which say that changing synapse config thru mediator is not recommended, hence would like to see if there are other options that would do this job for us.
One workaround would be to create those endpoints from the client side itself. This can be done by calling the AdminService APIs exposed by the carbon framework. In carbon, a front end of any carbon component talks to its back end through Admin Services. For example, if we take endpoints related functionalities, when you use the management console to create/delete or to do any functionalities, it would in turn call the respective back end via the "EndPointAdmin" admin service. Therefore I believe, if you want to programmatically create those endpoints, you can call the EndPointAdmin backend admin service (via EndPointAdminStub - it is the client stub corresponding to the aforesaid back end service) directly from your client side and get your requirement fulfilled.
Regards,
Prabath