Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Use SOAP with dropwizard

View AddNumbersService.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package com.example.helloworld.resources;
 
import javax.jws.WebMethod;
 
@javax.jws.WebService(
name = "AddNumbersPortType",
serviceName = "AddNumbersService",
targetNamespace = "http://duke.example.org")
@javax.jws.soap.SOAPBinding(
style = javax.jws.soap.SOAPBinding.Style.DOCUMENT,
use = javax.jws.soap.SOAPBinding.Use.LITERAL,
parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.WRAPPED)
public class AddNumbersService {
@WebMethod
public int Add(int a, int b) {
return a + b;
}
}
View AddNumbersService.java
1 2 3 4 5 6 7
public class SoapBundle implements Bundle {
@Override
public void initialize(Environment environment) {
environment.addServlet(new com.sun.xml.ws.transport.http.servlet.WSServlet(), "/SOAP/*");
environment.addServletListeners(new com.sun.xml.ws.transport.http.servlet.WSServletContextListener());
}
}
View AddNumbersService.java
1 2 3 4 5
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.6-2</version>
</dependency>
View AddNumbersService.java
1 2 3 4 5 6 7 8 9
<?xml version="1.0" encoding="UTF-8"?>
<endpoints
xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"
version="2.0">
<endpoint
name="HelloWorld"
implementation="com.example.helloworld.resources.AddNumbersService"
url-pattern="/SOAP/add"/>
</endpoints>

Hi,
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.