Flexible marshalling and unmarshalling using Spring WS

Talking about WebServices from a clients perspective, Spring WS provides some true simplifications when it comes to configuring and calling arbitrary Services. While emphasizing a contract-first view (with a clear focus on the schema of the request resp. response message payload), it supports a couple of ways to map an object graph to the stipulated message structure of the contracted request schema (marshalling) and of course vice versa, mapping the received response payload to an appropriate object structure (unmarshalling).
The following sections will give some demonstration on how to leverage the various options for marshalling and unmarshalling within Spring WS, especially by showing how to apply a strategy for marshalling and a different one for unmarshalling, all within the same WebService call. Read the rest of this entry »

How to call a WebService with Spring-WS through a Proxy

in analogy to some other well known templates within the spring framework, which encapsulate most of the boiler plate code when accessing and using infrastructure APIs (jdbc, jpa, jws, ldap, …), spring-ws offers as well a so called WebServiceTemplate, which allows clients for pretty easy and straightforward use of arbitrary WebServices.

the simplest way to use WebServiceTemplate is to extend from WebServiceGatewaySupport and use it via getWebServiceTemplate(): Read the rest of this entry »

SpringContracts – Design By Contract with seamless integration into Spring is now Open Source

it’s now about one and a half year ago that i was starting to deal with the question of how to increase the semantical expressiveness of software, mainly written in java.

of course you have interfaces in java to describe a kind of ‘contract’ on what methods an implementor of this contract have to provide to clients. but this kind of contract is way to poor in order to describe the semantical behaviour of a component, interface or class. it is easy to implement an interface with a completely different behaviour than the intended one (for example, i could implement a pop() method of an interface ‘Stack’ which delivers the first element at bottom of the Stack instead the one on top and though the interface ‘contract’ is statisfied).

we not only need contracts on a syntactical level but contracts on a semantical level in order to provide software with higher expressivenes and thus higher reliability. Read the rest of this entry »