Introduction to JAX-WS[http://jira.baeldung.com/browse/BAEL-611]
This commit is contained in:
Eunice Adutwumwaa Obugyei
2017-04-02 07:09:21 +00:00
parent fe8b413b69
commit 74447a163b
10 changed files with 31 additions and 44 deletions

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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");

View File

@@ -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");

View File

@@ -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;

View File

@@ -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();

View File

@@ -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;

View File

@@ -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 {

View File

@@ -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.