SOA / Web Services / Java

A Technology Blog

How to access Amazon AWS S3?

Posted by Vivek on August 22, 2015

Here are the steps to access Amazon S3 to access files stored on cloud.

  1. Download AWS CLI Installer from https://s3.amazonaws.com/aws-cli/AWSCLI64.msi. It can be 32 bit or 64 bit depending your system’s setting.
  2. Once downloaded, Install the AWS CLI
  3. Open the Command Prompt and navigate to the directory where AWS client is installed.
  4. Enter the command from the bin directory- aws configure

Provide the Access Key and Secret Access Key when asked. You can leave the region name and output format fields blank. Example below:

C:\windows\system32>aws configure

AWS Access Key ID [None]: [Access Key]

AWS Secret Access Key [None]: [Secret Access Key]

Default region name [None]:

Default output format [None]:

You can use clients such as S3 Browser to connect and access the files.

If you want to change the credentials, go to user home. You should be able to find .aws directory. It has two files – config and credentials. Credentials file should have access key id and secret access key.

Posted in SOA | Leave a Comment »

Testing/ Mocking WebServices using browser based plugins

Posted by Vivek on June 11, 2015

REST has rapidly become a part of almost all SOA or integration architectures. While there are tools like SOAPUi that can be used to test REST services, there are plugins which are more light-weight and provide good features

1. SOA Client (Firefox plugin)

It can be used to access SOAP based web services as well as UDDI registries. It can be added using the following link:

2. Postman (Chrome plugin)

It is an advanced REST service testing tool.

3. Mockable.io

It is not a plugin but a site that allows user to mock services and provides them with a unique URL which can be shared with other users.

Not just REST, it also allows to mock SOAP services.

Posted in SOA | Leave a Comment »

Ruby: Working with Postgres Database

Posted by Vivek on June 10, 2015

Firstly, install a ruby gem pg using the following command

gem install  pg

Then write a class to connect to database and retrieve values from a table

class PostGresClient

#!/usr/bin/env ruby

require ‘pg’

# Output a table of current connections to the DB
conn = PG.connect(“localhost”, 5432, , , “”, “”, “”)
res = conn.exec( “SELECT * FROM public.\”Employee\”)
res.each do |row|
row.each do |column|
puts column
end
end

end

Posted in SOA | Leave a Comment »

Ruby: Writing message to ActiveMQ

Posted by Vivek on June 10, 2015

The following piece of code can be used to write a message to ActiveMQ queue

require ‘rubygems’
require ‘jms’

config = {
:factory => ‘org.apache.activemq.ActiveMQConnectionFactory’,
:broker_url => ‘tcp://localhost:61616’,
:require_jars => [“~/Applications/apache-activemq-5.4.2/activemq-all-5.4.2.jar”]
}

JMS::Connection.session(config) do |session|
session.producer(:q_name => ‘myQueue’) do |producer|
producer.send(session.message(“Helloworld”))
end
end

Posted in SOA | Leave a Comment »

Ruby: Reading message from ActiveMQ

Posted by Vivek on June 10, 2015

The following piece of code can be used to read a message from queue using Ruby.

# Include JMS after ActiveMQ
require ‘rubygems’

require ‘jms’


# Connect to ActiveMQ
config = {
:factory => ‘org.apache.activemq.ActiveMQConnectionFactory’,
:broker_url => ‘tcp://localhost:61616’,
:require_jars => [“~/Applications/apache-activemq-5.4.2/activemq-all-5.4.2.jar”]
}
JMS::Connection.session(config) do |session|
session.consume(:q_name => ‘myQueue’, :timeout=>1000) do |message|
p message
end
end

Posted in SOA | Leave a Comment »

Ruby: Reading property file

Posted by Vivek on June 10, 2015

  1. Create a yml file containing properties:

Consider the following properties file with a property

         inputfile: C:\example\myfile.xml

  1. Load the properties file using the following command:

yml = YAML::load(File.open(‘properties.yml’))

  1. Fetch the property using the following statement:

yml[‘inputfile’]

Posted in SOA | Leave a Comment »

Call for papers – Hadoop

Posted by Vivek on June 5, 2015

The call for papers is open for Strata+Hadoop World 2015 in Singapore, Dec 1-3.
If you’re up for presenting and would like to share your ideas, case studies, best practices and technical knowledge submit your presentation proposals here before the June 18th deadline

Posted in SOA | Leave a Comment »

Free Mulesoft ESB Training

Posted by Vivek on June 5, 2015

Register now !!

https://training.mulesoft.com/mulesoft_u/developer_essentials

This is an 8-week self-study course for developers, architects, and technical managers who want to achieve ‘Associate MuleSoft Developer’ certification.

Posted in SOA | Leave a Comment »

Register for the Mulesoft Forum 2015 (July 14, 2015).. Free!!

Posted by Vivek on June 5, 2015

If you are a CIO, Project Manager, an Integration Architect, or Developer, don’t miss the opportunity to engage in an interactive discussions with your peers around digital transformation. You will walk away with a number of innovative ways to improve and transform projects and business initiatives with API-led connectivity.

At MuleSoft Forum, you’ll have the opportunity to:

  • Learn how Mule ESB Enterprise Edition offers reliability, performance, scalability, security – all out-of-the box.

  • See MuleSoft’s connectivity platform in action in a short live demo

  • Discover how API-Led Connectivity enables major business initiatives

  • Attend the exclusive MuleSoft ecosystem networking reception

http://www.cvent.com/events/forum-2015-mumbai/event-summary-1684136a44bc44508de58022bc59c63c.aspx?lang=en&sms=2

Posted in SOA | Leave a Comment »

ClassNotFOundException? – Command to find the required jar

Posted by Vivek on February 2, 2015

It is irritating when one gets ClassNotFoundException. One can go and find the jar and add it to the classpath to resolve the problem. Jars can be searched on sites like http://www.findjar.com. However, sometimes jars are within the system and only thing needed to fix the problem is to set the classpath appropriately. Here is the unix command to find the jar:
$ find . -name “*.jar” -print -exec jar -tf ‘{}’ \; | grep -E “jar$|String\.class”

Posted in SOA | Tagged: | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.