Contract-First Web-Services using JAX-WS, JAX-B, Maven and Eclipse

Using the contract-first approach to define a web service offers some advantages in contrast to the code-first approach. In the following tutorial we’re going to take a look at some details of this approach and we’re going to implement a real SOAP service using JAX-WS, Maven and the Eclipse IDE. Finally we’re going to run our service implementation on an embedded Jetty instance and we’re going to take a look at soapUI and how to test our service using this neat tool. ...

August 23, 2011 · 9 min · 1777 words · Micha Kops

Creating a SOAP Service using JAX-WS Annotations

It is possible to create SOAP webservices with only a few lines of code using the JAX-WS annotations. In a productivity environment you might prefer using contract-first instead of code-first to create your webservice but for now we’re going to use the fast method and that means code-first and annotations olé! Creating the SOAP Service Create a class SampleService with two public methods Annotate this class with @WebService (javax.jws.WebService) – now all public methods of this class are exported for our SOAP service To change the name of an exported method, annotate the method with @WebMethod(operationName = “theDesiredName”) (javax.jws.WebMethod) Finally the service class could look like this package com.hascode.tutorial.soap; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public class SampleService { @WebMethod(operationName = "getInfo") public String getInformation() { return "hasCode.com"; } public String doubleString(String inString) { return inString + inString; } } ...

September 23, 2010 · 2 min · 400 words · Micha Kops

Create a SOAP client using the JAX-WS Maven Plugin

Having written the article “How to build a Confluence SOAP client in 5 minutes” some readers asked me for some more information and help using the JAX-WS plugin that I mentioned in the article instead of the Axis plugin – so here we go ;) Steps Create a simple maven project first using archetype:create or archetype:generate mvn archetype:create -DgroupId=com.hascode.jaxws -DartifactId=soap-tutorial We get a pom.xml like this: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.hascode.jaxws</groupId> <artifactId>soap-tutorial</artifactId> <version>0.1</version> </project> ...

April 8, 2010 · 3 min · 530 words · Micha Kops

How to build a Confluence SOAP client in 5 minutes

In this tutorial we are going to build a SOAP client for the popular Confluence Wiki in about five minutes. The client is going to receive rendered HTML Markup from a specified Confluence Page. Prerequisites A running Confluence Installation with SOAP API enabled – if you don’t already have one take a look at this article or if you’ve got the Atlassian Plugin SDK installed .. start a standalone instance using atlas-run-standalone .. Maven – never go without it ;) Five minutes of your life time .. ...

March 28, 2010 · 3 min · 537 words · Micha Kops