/Web Services

SOAP Web Services with Apache CXF and Spring Boot

This post is based on one I wrote a few years ago about building contract first web services with Apache CXF and Spring. The previous post didnt use Spring Boot and most of the Spring and CXF configuration was via XML. This post moves things forward a bit by using the latest version of CXF and Spring Boot. Sample App We're going to build a simple Spring Boot app that exposes SOAP web service using Apache CXF.  The service will have a single operation that takes an account number and returns bank account details. If you're impatient and want to jump ahead you can grab [...]

By |2019-06-19T08:22:03+01:00June 19th, 2019|Spring, Spring Boot, Web Services|0 Comments

SOAP Services With MTOM

SOAP Services With MTOM SOAP is an XML based protocol which means that all data inside the SOAP envelope must be text based. If you want to include binary data in a SOAP message, it too must be text based. To achieve this you can convert binary data to a base64 encoded string and simply embed the string inside the SOAP message. The diagram below shows a sample SOAP message with binary data embedded as a base64 string. Sending Binary Data with SOAP Without MTOM While this is a simple approach for dealing with binary data with SOAP, there are a few things to [...]

By |2019-02-07T17:11:27+01:00June 19th, 2017|Web Services|0 Comments

Apache CXF – Contract First Web Services

Apache CXF - Contract First Web Services I wrote a post a few years ago detailing a step by step guide to building a contract first web service using Spring.  I recently started working with Apache CXF and thought it would be worth putting together a more up to date post, this time using CXF. We'll create a fictitious Account Service that takes a single account number parameter and returns associated account information. Although the sample service will be very simple, the approach taken should provide you with a solid foundation upon which to build real world services. Source Code The full source code for this post [...]

By |2019-02-12T07:29:21+01:00October 5th, 2016|Spring Boot, Web Services|4 Comments

Axis2 Web Service Client Tutorial

Axis2 Web Service Client Tutorial Axis2 is a Java framework that provides comprehensive support for exposing and consuming web services. This short post will look at its SOAP client support and how it can be used to get a simple web service client up and running. For convenience I'll be calling a web service that I recently built as part of another post.  If you don't already have a web service to call you can grab the full source code for my sample service from github. Run a Maven build and deploy the WAR to your Servlet container. What is a Web Service Client? This [...]

By |2019-02-20T08:15:40+01:00January 29th, 2013|Web Services|20 Comments

Spring Web Services Tutorial

Spring Web Services Tutorial I've recently written a more up to date version of this post which describes how to build a contract first web service using Apache CXF. Check it out here. SOAP Services Modern enterprise applications are rarely stand alone and often rely on data and services provided by external systems. In order for different types of systems to communicate there must be a  communication protocol of some sort, a standard way of sending and receiving messages in a format that is recognised and supported by all major platforms. SOAP (Simple Object Application Protocol) is such a protocol, and allows applications to communicate by exchanging [...]

By |2019-02-20T17:03:03+01:00January 14th, 2013|Spring, Web Services|118 Comments

Java Web Service Client – Proxy Configuration

Java Web Service Client - Proxy Configuration I've spent the last few days integrating an application with the Experian bank account validation service, using Axis2 as the web service client. The client worked fine in our dev environment  but couldnt connect when deployed in the customers corporate network. The Axis client was throwing an UnknownHostException because it couldn't resolve the service URL. Strangely though, on the same machine I was able to paste the URL into a browser and view the service WSDL.  After some digging around I realised that all HTTP requests that go out to the public internet need to be routed through the [...]

By |2019-02-21T17:13:03+01:00July 14th, 2012|Web Services|6 Comments