Ola
Estou com dificuldade de fazer o meu WS ler um objeto (NotaFiscalVO nota) que estou enviando para ele.
Abaixo como estou enviando
private static final String URL_WS = “http://187.45.235.38:8080/WS/notaCliente/”;
public String salvaNota(NotaFiscalVO nota) throws Exception {
Gson gson = new Gson();
String notaJSON = gson.toJson(nota);
String[] resposta = new WebServiceCliente().post(URL_WS + "salvaNota", notaJSON);
if (resposta[0].equals("200")) {
return resposta[1];
} else {
throw new Exception(resposta[1]);
}
}
}
aqui como estou recebendo o dado no meu WS
@Path("/notaCliente")
public class NotaFiscalResorce {
@POST
@Path("/salvaNota")
@Produces("application/json")
@Consumes("application/json")
public int inserirCliente(NotaFiscalVO nota) {
return new NotaFiscalBusiness().insereNota(nota);
}
}
Esta me retornando
" The specified HTTP method is not allowed for the requested resource "
Podem me ajudar?
Obrigado.