---
title: 'JAX-WS 2.1 with Spring under Java 6'
url: 'https://tutego.de/blog/javainsel/2007/03/jax-ws-2-1-with-spring-under-java-6'
markdown: 'https://tutego.de/blog/javainsel/2007/03/jax-ws-2-1-with-spring-under-java-6.md'
date: '2007-03-13'
description: 'First you need some jars in your classpath of an web application commons-logging.jar jaxw-api.jar jaxws-rt.jar jaxws-spring-1.1.jar saaj-api.jar saaj-impl.jar spring.jar stax-ex.jar streambuffer.jar xbean-spring-2.8.jar The Jars are from Spring itself, , https://jax-ws.dev.java.net/ (jax-ws 2.1, …'
taxonomy:
  category:
    - Spring
---

# JAX-WS 2.1 with Spring under Java 6

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## JAX-WS 2.1 with Spring under Java 6

13.03.2007 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

First you need some jars in your classpath of an web application

- *commons-logging.jar*
- *jaxw-api.jar*
- *jaxws-rt.jar*
- *jaxws-spring-1.1.jar*
- *saaj-api.jar*
- *saaj-impl.jar*
- *spring.jar*
- *stax-ex.jar*
- *streambuffer.jar*
- *xbean-spring-2.8.jar*

The Jars are from Spring itself, , [https://jax-ws.dev.java.net/](https://jax-ws.dev.java.net/ "https://jax-ws.dev.java.net/") (jax-ws 2.1, JAXWS2.1\_nightly.zip) and [https://jax-ws-commons.dev.java.net/spring/](https://jax-ws-commons.dev.java.net/spring/ "https://jax-ws-commons.dev.java.net/spring/") ([jaxws-spring-1.1.jar](https://maven2-repository.dev.java.net/source/browse/maven2-repository/trunk/www/repository/org/jvnet/jax-ws-commons/spring/jaxws-spring/1.1/jaxws-spring-1.1.jar)). It is although important to place

- *jaxb-api.jar*
- *jaxb-impl.jar*

under *C:\\Programme\\Apache Software Foundation\\Tomcat 5.5\\common\\endorsed*.

This was the necessary and boring preparation.

Next the Web Service itself

```java
package com.tutego.service;
```

```java
import javax.jws.WebMethod;import javax.jws.WebService;import javax.jws.soap.SOAPBinding;  @WebService@SOAPBinding(style = SOAPBinding.Style.RPC)public class GreeterService{@WebMethodpublic String greet( String name ){return "Hello " + name + "!"}}
```

And web.xml:

```text
SpringWebindex.htmlindex.htmindex.jspdefault.htmldefault.htmdefault.jspcontextConfigLocation/WEB-INF/applicationContext.xmlorg.springframework.web.context.ContextLoaderListenerjaxws-servletcom.sun.xml.ws.transport.http.servlet.WSSpringServletjaxws-servlet/greet
```

The `applicationContext.xml` follows the suggestions with the namespace.

```text

```

Now you can consume your WS. If your Web-Context is SpringWeb use <http://localhost:8080/SpringWeb/greet?wsdl>. Enjoy it!

Kategorien: [Spring](https://tutego.de/blog/javainsel/category/spring/)

[← Alle Beiträge](https://tutego.de/blog/javainsel/)

---

## Navigation

- Previous: [Spring in einer Web-Applikationen nutzen - so einfach ist das](https://tutego.de/blog/javainsel/2007/03/spring-in-einer-web-applikationen-nutzen-so-einfach-ist-das.md)
- Next: [Insel: Innere Klasse und Serializable](https://tutego.de/blog/javainsel/2007/03/insel-innere-klasse-und-serializable.md)
