Strategy Design Pattern and Single Responsibility and Open-Closed Principles

June 11, 2013 Tutorial Copyright © Binu George

Strategy design pattern is widely implemented to achieve interchangeable algorithmic behavior at runtime. As we know strategy pattern uses aggregation or composition instead of inheritance. It is a behavioral design pattern. The behaviors are defined in separate interfaces and the encapsulating classes that implement this interface. Generally most of the SOLID principles can be identified […]

Factory Design Patterns and Open-Closed Principle (OCP), the ‘O’ in SOLID

June 6, 2013 Tutorial Copyright © Binu George

Factory Design patterns are Creational patterns and deals with how the objects are created. There are three design patterns, namely, Simple Factory, Factory Method and Abstract Factory design patterns. All these patterns hide the object creation process from the client and supply the objects without specifying the exact class of object that will be created. […]

JAX-WS Exceptions and Faults: Annotation, Exception and Fault Handling Examples

May 31, 2013 Tutorial Copyright © Binu George

JAX-WS exception fault handling example

JAX-WS exception and SOAP fault handling sometimes confuses a Java programmer. This article explains the handling of JAX-WS exceptions and SOAP Fault with examples. Here, we also check some of the common Exceptions such as “IllegalAnnotationExceptions. java.lang.StackTraceElement does not have a no-arg default constructor.“. This article also discusses the JAX-WS mapping of WSDL faults to […]

Design Considerations: When Should We Use JSON instead of XML as Data-interchange Format?

May 23, 2013 Tutorial Copyright © Binu George

As we know, JSON (JavaScript Object Notation) is a lightweight and text based data-interchange format that is used frequently replacing XML. The question is, when should we consider JSON instead of XML as the data interchange format? Table of Contents Few Points: JSON and XML JavaScript Runtime and JSON Performance & bandwidth Considerations Security and […]

Java Performance – String, StringBuffer and StringBuilder Memory and Runtime Analysis

May 22, 2013 Tutorial Copyright © Binu George

We normally use many string instances in our applications. As we know String objects are immutable and their values cannot be changed after they are created. If you intend to use a string object that is dynamic, then StringBuffer or StringBuilder should be your choice. This is because both are mutable. String always creates a […]

How to Fix : java.security.cert.CertificateException: No name matching localhost found

May 21, 2013 Tutorial Copyright © Binu George

How to Fix the exception ” java.security.cert.CertificateException: No name matching localhost found”, when client uses URL with “localhost” as host name to access some secure service over HTTPS? In this article we will check the root cause of the issue and will try two different solutions two fix the same. Table of Contents When Do […]

Logging or Tracing Web Service XML Request/Response with JAX-WS

May 20, 2013 Tutorial Copyright © Binu George

How to Log Request and Response With Java JAX-WS web-service Server and Client? We have discussed many examples to develop secure web services with JAX-WS API and using the Metro web service stack. We also discussed how to enable Message Transmission Optimization Mechanism (MTOM) to optimize the data transfer between services and clients. In our […]

Secure Metro JAX-WS UsernameToken Web Service with Signature, Encryption and TLS (SSL)

May 19, 2013 Tutorial Copyright © Binu George

jax-ws usernametoken example

Java Web Services Security: How to Secure JAX-WS UsernameToken Web Service with Signature, Encryption and TLS (SSL) Securing the data exchanged between web service producers and consumers is essential to ensure confidentiality, authenticity and integrity of critical business data. There are many approaches to implement Web Service Security (WSS) popularly called as WS-Security. WS-Security is […]

JAX-WS Secure Web Services with Signatures and Encryption: WS-Security with Metro and WSIT

May 16, 2013 Tutorial Copyright © Binu George

jax-ws web services encryption signature java

Java Web Services: Create Secure JAX-WS Metro Web Service Signed and Encrypted Using Public-Key Cryptography Asymmetric Encryption Security is the primary concern when web services exchange critical business data. WS-Security is an is an extension to SOAP to apply security to web services. It is one of the main part of WS-* specification from OASIS. […]

JAX-WS and Secure Java Web Services using UsernameToken : WS-Security with Metro and WSIT

May 14, 2013 Tutorial Copyright © Binu George

jax-ws usernametoken example

JAX-WS and Secure Java Web Services using UsernameToken: WS-Security with Metro and WSIT Example This tutorial focuses on creating secure JAX-WS web service with UsernameToken WS-Security profile by using Metro and WSIT. You will learn how to create , deploy and run JAX-WS UsernameToken web service security example and UsernameToken jax-ws client. We will also […]