Showing posts with label Axis2. Show all posts
Showing posts with label Axis2. Show all posts

Thursday, August 16, 2012

How to encrypt axis2.xml passwords with secure vault

The passwords in xml files (eg: axis2.xml) can be secured from secure vault.
 
Locate cipher-text.properties which can be found at <CARBON_HOME>/repository/conf directory in your WSO2 product. This file contains the alias names and the corresponding plain text password in square brackets.

If you can not find this file in your product,  download it from this [1] svn location.

Configure cipher-text.properties file with your passwords.

The following entry should be added in order to secure the password in axis2.xml
Axis2.Https.Listener.KeyStore.KeyPassword=[wso2carbon]

Locate "ciphertool" script which can be found at <CARBON_HOME>/bin directory. If you can not find this file in your product,  download it from [2] svn location and copy to above location.

Run "ciphertool" script with -Dconfigure option. eg: ciphertool.sh -Dconfigure

The passwords (in axis2.xml) should be encrypted now.

Start the server. In startup, the master password is required. (wso2carbon).

More details available at [3] and [4]

[1] https://svn.wso2.org/repos/wso2/branches/carbon/3.2.0/core/distribution/3.2.0/carbon-home/repository/conf/cipher-text.properties
[2] https://svn.wso2.org/repos/wso2/branches/carbon/3.2.0/core/distribution/3.2.0/carbon-home/bin/
[3] http://pathberiya.blogspot.com/2012/08/secure-plain-text-passwords-in-wso2.html
[4] http://wso2.org/project/carbon/3.2.0/docs/secure_vault.html

Thursday, April 12, 2012

How to use HTTP Basic Authentication to secure services

HTTP Basic authentication is a popular topic in the SCWCD/OCWCD (Oracle Certified Web Component Developer exam).  It can be used to secure web services too.
While i was reading some blog posts during the vacation i came across an interesting post related to securing web services using HTTP Basic Auth and invoking the secured service with a web service client.

Here is the link to the post : http://blog.facilelogin.com/2008/11/secure-your-service-with-http-basic.html



Tuesday, April 10, 2012

Say 'Hello' to Apache Axis2

During the vacation i read some articles and books about various interesting topics which i like most. I read about axis2 also. And i decided to write a post which will help a person without any clue about axis2.

What is apache axis2
"Apache Axis2™ is a Web Services / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack. There are two implementations of the Apache Axis2 Web services engine - Apache Axis2/Java and Apache Axis2/C"

This post is related to Apache Axis2/Java. We will write a simple Java class and make it a service. 
You can download Apache Axis2 from here

/**
 * The service implementation class
 */
public class HelloService {

/**
* The sayHello method will be exposed as the 
* sayHello operation of the web service
*/
public String sayHello(String value) {
return "Hello"+value;
}
}

Save the above class as HelloService.java

Each Axis2 service must have a services.xml file which will inform Axis2 about the service. Following is the services.xml file for the HelloService Web service.

<service>
<parameter name="ServiceClass" 
          locked="false">HelloService</parameter>
<operation name="sayHello">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>    
</service>

Save it as services.xml .

These should be packaged according to a format in order to be deployed in Axis2.

Create a directory called  "package".  mkdir package.
Next , compile the HelloService.java class and move the HelloService.class file to the package directory.

Now create a META-INF directory within the 'package' and copy the services.xml file in to META-INF directory.

javac HelloService.java -d package/

Change the directory to package and use the following command to create the axis2 archive file.

jar -cvf HelloService.aar *

Copy the HelloService.aar to axis2-1.6.0/repository/services and the service will be listed




Using Zotero for academic writing