Merged from https://github.com/eugenp/tutorials
Introduction to JAX-WS[http://jira.baeldung.com/browse/BAEL-611]
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
package com.baeldung.jaxws;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
|
||||
import com.baeldung.jaxws.exception.EmployeeAlreadyExists;
|
||||
import com.baeldung.jaxws.exception.EmployeeNotFound;
|
||||
import com.baeldung.jaxws.model.Employee;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
import java.util.List;
|
||||
|
||||
@WebService
|
||||
public interface EmployeeService {
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.baeldung.jaxws;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
|
||||
import com.baeldung.jaxws.exception.EmployeeAlreadyExists;
|
||||
import com.baeldung.jaxws.exception.EmployeeNotFound;
|
||||
import com.baeldung.jaxws.model.Employee;
|
||||
import com.baeldung.jaxws.repository.EmployeeRepository;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebService;
|
||||
import java.util.List;
|
||||
|
||||
@WebService(serviceName = "EmployeeService", endpointInterface = "com.baeldung.jaxws.EmployeeService")
|
||||
public class EmployeeServiceImpl implements EmployeeService {
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.baeldung.jaxws.config;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
||||
import com.baeldung.jaxws.EmployeeServiceImpl;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
||||
public class EmployeeServicePublisher {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.baeldung.jaxws.exception;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.xml.ws.WebFault;
|
||||
|
||||
@WebFault
|
||||
public class EmployeeAlreadyExists extends Exception implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class EmployeeAlreadyExists extends Exception {
|
||||
|
||||
public EmployeeAlreadyExists() {
|
||||
super("This employee already exists");
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.baeldung.jaxws.exception;
|
||||
|
||||
import javax.xml.ws.WebFault;
|
||||
import java.io.Serializable;
|
||||
|
||||
@WebFault
|
||||
public class EmployeeNotFound extends Exception implements Serializable {
|
||||
public class EmployeeNotFound extends Exception {
|
||||
|
||||
public EmployeeNotFound() {
|
||||
super("The specified employee does not exist");
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.baeldung.jaxws.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Employee implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class Employee {
|
||||
private int id;
|
||||
private String firstName;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.baeldung.jaxws.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baeldung.jaxws.exception.EmployeeAlreadyExists;
|
||||
import com.baeldung.jaxws.exception.EmployeeNotFound;
|
||||
import com.baeldung.jaxws.model.Employee;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EmployeeRepository {
|
||||
|
||||
List<Employee> getAllEmployees();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.baeldung.jaxws.repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.baeldung.jaxws.exception.EmployeeAlreadyExists;
|
||||
import com.baeldung.jaxws.exception.EmployeeNotFound;
|
||||
import com.baeldung.jaxws.model.Employee;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EmployeeRepositoryImpl implements EmployeeRepository {
|
||||
private List<Employee> employeeList;
|
||||
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
package com.baeldung.jaxws;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.Service;
|
||||
|
||||
import com.baeldung.jaxws.exception.EmployeeAlreadyExists;
|
||||
import com.baeldung.jaxws.exception.EmployeeNotFound;
|
||||
import com.baeldung.jaxws.model.Employee;
|
||||
import com.baeldung.jaxws.repository.EmployeeRepository;
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.junit.Arquillian;
|
||||
import org.jboss.arquillian.test.api.ArquillianResource;
|
||||
@@ -19,10 +14,13 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import com.baeldung.jaxws.exception.EmployeeAlreadyExists;
|
||||
import com.baeldung.jaxws.exception.EmployeeNotFound;
|
||||
import com.baeldung.jaxws.model.Employee;
|
||||
import com.baeldung.jaxws.repository.EmployeeRepository;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.Service;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@RunWith(Arquillian.class)
|
||||
public class EmployeeServiceLiveTest {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package org.baeldung.lagom.helloworld.weather.impl;
|
||||
|
||||
import org.baeldung.lagom.helloworld.weather.api.WeatherService;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.lightbend.lagom.javadsl.server.ServiceGuiceSupport;
|
||||
import org.baeldung.lagom.helloworld.weather.api.WeatherService;
|
||||
|
||||
/**
|
||||
* The module that binds the GreetingService so that it can be served.
|
||||
|
||||
Reference in New Issue
Block a user