Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use SOAP with dropwizard
package com.example.helloworld.resources;
import javax.jws.WebMethod;
name = "AddNumbersPortType",
serviceName = "AddNumbersService",
targetNamespace = "")
style = javax.jws.soap.SOAPBinding.Style.DOCUMENT,
use = javax.jws.soap.SOAPBinding.Use.LITERAL,
parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED)
public class AddNumbersService {
public int Add(int a, int b) {
return a + b;
public class SoapBundle implements Bundle {
public void initialize(Environment environment) {
environment.addServlet(new, "/SOAP/*");
<?xml version="1.0" encoding="UTF-8"?>

This comment has been minimized.

Copy link

@archanmishra archanmishra commented May 11, 2015

Can you please point me to resource/documentation on adding the jax-ws.xml to the dropwizard project.
Since I am getting WEB-INF/jax-ws.xml not found error on my app startup.


This comment has been minimized.

Copy link

@LipikaM LipikaM commented Mar 21, 2017

Its giving this error: /WEB-INF/sun-jaxws.xml missing. Can you help.


This comment has been minimized.

Copy link

@anchoo2kewl anchoo2kewl commented Jul 12, 2017

The missing "/WEB-INF/sun-jaxws.xml" is caused due to the WSServletContextListener trying to fetch the URL to sunJaxWsXml. Stepping through the code got me to the ContextHandler which checks the _baseResource value, which was never set when setting the servlet.
The most important bit is to set the resource base, without which the context would never find xml file, no matter where you place the file.

I am using dropwizard 0.7.1 and I add this to the run method of my Application class.

ServletEnvironment servlet = environment.servlets();
servlet.addServlet("/SOAP/*", new;

And then ensure /WEB-INF/sun-jaxws.xml exists in the root directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment