SHARE
TWEET

Untitled

a guest Jul 18th, 2019 461 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class TicketManagementBackendWS implements TicketManagementBackend {
  2.     private static final String wsdlLocation = "http://localhost:8080/custom/HistoryService?wsdl";
  3.     List<Ticket> ticketList;
  4.  
  5.     @Override
  6.     public void triggerShutdown() {
  7.         // TODO Auto-generated method stub
  8.  
  9.     }
  10.  
  11.     public TicketManagementBackendWS() {
  12.         // TODO Auto-generated constructor stub
  13.         this.ticketList = new ArrayList<Ticket>();
  14.     }
  15.  
  16.     @Override
  17.     public Ticket createNewTicket(String reporter, String topic, String description, Type type, Priority priority)
  18.             throws TicketException {
  19.         // TODO Auto-generated method stub
  20.         URL location = new URL(wsdlLocation);
  21.         String namespace = "http://backendUdp.rz.uniba.de/";
  22.          QName serviceName = new QName(namespace, "TicketServiceService");
  23.         Service service = Service.create(location, serviceName);
  24.         QName portName = new QName(namespace, "TicketServicePort");
  25.  
  26.          TicketService proxy = service.getPort(portName, TicketService.class);
  27.  
  28.          de.uniba.rz.backendwebservice.Ticket createdTicket = proxy.createNewTicket(reporter, topic, description, type, priority);
  29.          
  30.          Ticket newTicket = new Ticket();
  31.          newTicket.setReporter(reporter);
  32.          newTicket.setTopic(topic);
  33.          newTicket.setDescription(description);
  34.          newTicket.setType(type);
  35.          newTicket.setPriority(priority);
  36.          newTicket.setStatus(status);
  37.          
  38.          this.ticketList.add(newTicket);
  39.  
  40.         System.out.println("Accessing Web service...");
  41.          System.out.println("Getting tickets from " + createdTicket);
  42.        
  43.         return newTicket;
  44.     }
  45.  
  46.     @Override
  47.     public List<Ticket> getAllTickets() throws TicketException {
  48.         // TODO Auto-generated method stub
  49.         return this.ticketList;
  50.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top