Tomcat Security Realm

Posted Posted in Java, WebServices

Tomcat Security Realm Tomcat provides container managed security using Realms. Realm is a collection of usernames and passwords along with any authorization roles associated with username. Security information is normally stored in a database. Realms provide details about how the security information is stored and accessed.   Here are the 6 standard realms provided with […]

Keystore, Truststore and KeyTool in Java

Posted Posted in Core Java, Java, WebServices

  An HTTPS server needs two stores for the certificates :  Keystore : Keystore stores digital certificates, including certificates sent by Server during peer autentication phase. When a server is challenged to verify identity, server can send certificates for its keystore to the challenger. If peer authentication is mutual, client also needs a keystore to […]

wsgen utility

Posted Posted in Java, WebServices

wsgen utility helps generate WSDL given the webservice classes. Here is the code for

Here is the syntax for creating wsdl from it: wsgen -cp . -wsdl com.techkatak.Hello This will generate a WSDL named HelloService.wsdl

wsgen can also be used to generate JAX-B artifacts. Here is the syntax for the same : […]

schemagen and xjc

Posted 1 CommentPosted in Java, WebServices

Both these utilities are included as part of JDK. schemagen utility can generate an XML Schema instance from a POJO. xjc can generate java classes from a XML schema. These utilities can be invoked from command line as follows: schemagen [-options] <java files> For example, lets create a java projct and create a class […]

JAX WS HTTPS Hello World using Eclipse and Tomcat

Posted Posted in Java, WebServices

In this article, we will create a soap service for HTTPS and deploy it on Tomcat. We will first need to setup Tomcat for HTTPS. Please refer the below link for the setup: Tomcat setup for HTTPS Now lets create a webservice with User/Roles security. Step 1: Create a Dynamic Web Project using Eclipse and […]

Symmetric and Asymmetric Encryption/Decryption

Posted Posted in Java, WebServices

Basic Encryption/Decryption strategy: The aim of encrypting/decrypting data is to make sure the data sent by sender can be understood by the intended recipient only. For example, if person A is sending a message to person B, another person C eavesdropping to the message should not be able to read it. So, sender (A) encrypts […]

WSDL contract structure for Hello service

Posted Posted in Java, WebServices

In the below post, we created a JAX WS service. JAX WS Hello World using Eclipse We used below url to get the WSDL for Hello Service. http://localhost:8080/SOAPWS/HelloService?wsdl Here is the WSDL we generated for Hello service in this post :

The below section provides an understanding of the elements in this WSDL: definitions: […]