Posts

Showing posts from 2014

Integrate Microsoft Email Webservice Service (EWS) using JAVA

In this post we will see how to integrate the Microsoft Email Webservice (EWS) with JAVA using the open source EWS-JAVA-API.  Download the ews-java-api source code here. ews-java-api I was not able to find the binaries for ews-java-api, thus I build the project using maven. Below lib are need to run the JAVA program: 1. Binary for ews-java-api . 2. jcifs-1.3.17.jar 3. httpcore-4.3.3.jar 4. httpclient-4.3.6.jar 5. commons-logging-1.2.jar 6. commons-codec-1.6.jar 7. commons-cli-1.2.jar Please find the simple program to send the email using MS-EWS. The program is explain with the comments inline. The HTTPS i.e. SSL url is used, there is no need to include the certificate in credential store as the API internally validate the certs. package com; import java.net.URI; import microsoft.exchange.webservices.data.EmailMessage; import microsoft.exchange.webservices.data.ExchangeCredentials; import microsoft.exchange.webservices.data.ExchangeService; import microsoft.exchange

Implementing PGP (Pretty Good Privacy) using Bouncy Castle Crypto APIs

I was just exploring the Java API's for encrypting and decrypting the file using PGP (Pretty Good Privacy), and I came across Bouncy Castle Crypto APIs. Here we will simply see how to use the Bouncy Castle APIs. Firstly download the cypto jar from the bouncy castle site, you can find the links in the end. 1.        Extract the Jar “crypto-145” at   2.      The java classes are at location “.crypto-145\src\org\bouncycastle\openpgp\examples” Use the jar’s at “crypto-145\jars” as per your SDK:- I have used bcpg-jdk16-145.jar and bcprov-jdk16-145.jar You need to first compile the JAVA classes. Lets create the public and private key:- 1. We will use  RSAKeyPairGenerator.java java class to generate the key’s         java org . bouncycastle . openpgp . examples . RSAKeyPairGenerator charlie "open sesame"    ---where            --  Charlie is identity         -- “ open sesame ” is passName Example: java -cp "D:\pgp\crypto-145\crypto-145\

Dynamic Routing in OSB

Image
In this post we will see how to use OSB dynamic routing feature to Route Request to different proxy/business service at run time.  To demonstrate how Dynamic Routing works, we will first create two proxy service with Mocked response indicating which proxy service got called. We will have customer creation service, which creates the customer either in CRMOD or OCH based on the parameter passed in request. There will be 3 proxy services: 1.      OCH proxy service : a.       URI : /proxy/ ochCreateCustomer This proxy will return the mocked response i.e. “customer created in OCH” 2.      CRMOD proxy service: a.       URI : /proxy/ crmodCreateCustomer This proxy will return the mocked response i.e. “customer created in CRMOD” 3.      Create Customer Orchestration service: a.       URI: /proxy/ createCustomer This proxy receives request in any XML format, with the parameter indication where customer must be created.   The