Tuesday, August 23, 2016

Enabling client authentication in MongoDB

Before enabling authentication in MongoDB, we'll have to create a user and assign it a built-in role. We'll use the built-in "root" role that provides admin access to all databases.

I've done this in Ubuntu using MongoDB 3.2.

Sunday, August 7, 2016

Limiting grep output

Here's a quick way to limit output of the grep command.

Most of the time, we issue the following to find needle in the haystack:

grep needle file.txt

This prints out the matching pattern. If the output is way too long and we only need a section of it, we can use the extended grep (a.k.a. egrep) option.

Wednesday, July 27, 2016

Enabling WS-Security in Spring Boot using CXF, JAX-WS and JAXB

In my previous post, I've shown how to quickly create a WSDL/SOAP based web service. This post will build on top of that to include WS-Security. We'll be using simple username/password authentication.

Friday, July 22, 2016

Getting Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions...

My previous post shows how we can easily create a SOAP based web service using Spring Boot, CXF, JAX-WS and JAXB.

There's a small matter to note when naming functions. The following function naming works:

package com.techtots.services;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlElement;

import com.techtots.contracts.UserRegisterRequest;
import com.techtots.contracts.UserRegisterResponse;

public interface UserService {
    @WebResult(name = "userRegisterResponse")
    public @XmlElement(required = true, nillable = false) UserRegisterResponse registerUser(
            @XmlElement(required = true, nillable = false) 
            @WebParam(name = "userRegisterRequest")
            UserRegisterRequest userRegisterRequest);

Creating WSDL/SOAP web services in Spring Boot using CXF, JAX-WS and JAXB

Here's a quick way to use Spring Boot to expose web services via WSDL/SOAP using CXF, JAX-WS and JAXB.

Add the following artifacts into your Spring Boot pom.xml: