Skip to content

Instantly share code, notes, and snippets.

View lahirue's full-sized avatar

Lahiru J Ekanayake lahirue

View GitHub Profile
@lahirue
lahirue / Simple JSP For WSO2 Carbon Component UI
Created October 21, 2015 06:41
Simple JSP For WSO2 Carbon Component UI
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>Hello world Lahiru</h1>
@lahirue
lahirue / WSO2 Carbon Component UI Maven Project pom.XML
Created October 21, 2015 06:37
WSO2 Carbon Component UI Maven Project pom.XML
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2</groupId>
<artifactId>org.wso2.carbon.test1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Test1</name>
@lahirue
lahirue / REST Read URL Pattern
Created October 21, 2015 06:33
REST Read URL Pattern
@POST
@Path("{userName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public User addNewUser(@PathParam("userName") String anUserName, User anUser){
System.out.println(anUser.getName());
System.out.println(anUserName);
return anUser;
}
@lahirue
lahirue / REST JSON Dependency
Last active October 21, 2015 06:34
REST JSON Dependency
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
</dependency>
@lahirue
lahirue / REST Details Class1
Created October 21, 2015 06:28
REST Details Class1
package org.wso2.advanceREST;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@lahirue
lahirue / REST User Class
Created October 21, 2015 06:26
REST User Class
package org.wso2.advanceREST;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class User {
private String Name;
private int age;
public User(){
@lahirue
lahirue / WSO2 ESB Secured Client
Created October 21, 2015 06:20
WSO2 ESB Secured Client
package org.wso2;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import org.apache.axis2.Constants;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
@lahirue
lahirue / WSO2 ESB Proxy Client
Created October 21, 2015 06:17
WSO2 ESB Proxy Client
package org.wso2;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import org.wso2.MyTest1Stub.GetMyValues;
public class MyTest1 {
public static void main(String[] args) throws RemoteException {
@lahirue
lahirue / Axis2 Client
Created October 21, 2015 06:10
Axis2 Client
package org.wso2;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import org.wso2.MyTest1Stub.GetMyValues;
public class MyTest1 {
public static void main(String[] args) throws RemoteException {
@lahirue
lahirue / Axis2 Service
Created October 21, 2015 05:58
Axis2 Samples
package org.wso2;
public class MyTest1 {
public int getMyValues(int x){
return x*3;
}
}