Home Can't find the the request for observer in Apache-cfx
Reply: 0

Can't find the the request for observer in Apache-cfx

user1599
1#
user1599 Published in April 23, 2018, 9:34 am

I am trying to read the patients by using Rest in postman but am getting

NO SERVICE FOUND

in postman and

Can't find the the request

in console.

Here is my code:

package com.simhapurihospitals.patients.model;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "patient")

public class Patients {

  private int id;

  private String name;

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

}

package com.simhapurihospitals.patients;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

import com.simhapurihospitals.patients.model.Patients;

@Path("/patientservice")
public interface PatientsService {

  @Path("/patients")
@GET
public List < Patients > getListofpatients();

}

@Service

public class PatientsServiceImpl implements PatientsService {

  Map<Integer, Patients> patients = new HashMap<>();

  private Collection<Patients> values;

  public PatientsServiceImpl() {

    init();
  }
  void init(){
  Patients patient = new Patients();
  patient.setId(23);
  patient.setName("nishith");
  patients.put(patient.getId(), patient);
}

@Override
public List < Patients > getListofpatients() {

  values = patients.values();
  List < Patients > results=new ArrayList<>(values);
  return results;
}

}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.378044 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO