Skip to main content

Posts

Showing posts with the label Java

WSO2 Siddhi Advance Example

I would like to present you today how to write an advance siddhi query for wso2 das. I would skip basic steps hoping you are already familiar with siddhi event processing language and DAS server. Siddhi - Is an event processing language created by WSO2. this language has a very similar behavior to SQL query language, except siddhi query triggered by a receiving event. siddhi syntaxes bit upside down when compared to traditional SQL. DAS - DAS is the data analytic server introduced by WSO2. Introduction What my example doing is when DAS server is receiving an event it flows through my siddhi example. DAS is connected to an external system and DAS receives events. this event has json body where event-type is hidden. based on the event type we will be pricing the event and pushing updated stream data to a new stream. so to make a result we will have to process the event using siddhi java extension. Before explaining the siddhi query, let me explain you various functions ...

2 Legged OAuth 1.0 with Java Spring REST Client Example

Today I am going to show you how to consume an oAuth 1.0 secured rest service using a java spring rest template class. We can create a simple standalone class to do this exercise.  so let's start by creating simple java spring application. 1. Let's add a new class to the project as MyOAuthSample.java 2. Create a main method so we can execute the application independently. In the main method we will create an instance of MyOAuthSample class and call the showCourseMode() method.     public static void main(String[] args) {         new MyOAuthSample().showCourseMode();     } 3. Write showCourseMode() method. here we will be using spring provided  OAuthRestTemplate class to call the rest service. This template requires OAuth parameters to create. they are passed via getResouces().     private void showCourseMode() {         OAuthRestTemplate authRestTemplate=n...

Axis 2 WSDL to Java Approach

Axis 2 Tomcat Setup Download Axis 2 war distribution from http://axis.apache.org/axis2/java/core/download.cgi Now install it to Tomcat by copying the axis2.war file to webapps directory of tomcat installation. Axis2 folder should be created automatically if tomcat is up and running. We can conclude this part if http://localhost:8080/axis2 is ok. Validate link in the page shouldn't show any errors. Implementation create simple maven project in eclipse using create simple project option in the first window. name myHelloService2 Use following as the wsdl for our web service <definitions name="HelloService"    targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"    xmlns="http://schemas.xmlsoap.org/wsdl/"    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"    xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"    xmlns:xsd="http://www.w3.org/2001/XMLSchema">    <message name="Sa...