First you should read the wsdl created by the webservice and create an interface in your project that has access to the methods you need. For this you need (at least in this case) apache cxf. Simply use the command
[caminho]\apache-cxf-2.2.7\bin>wsdl2java -p [pacote que será criado] -d "[caminho onde será criado o pacote]" [seuWebservice?wsdl]
if you have xml on your machine you can replace the url with the xml path
after that the method call is the same as any other interface call, follow an example (here the webservice has a method called query PorId that will be consumed by the method returning a company)
public Empresa consultarEmpresaPorId(Long id) {
ConsultarEmpresaPorIdRequest request = new ConsultarEmpresaPorIdRequest();
request.setIdEmpresa(id.intValue());
ConsultarEmpresaPorIdResponse response = WEBSERVICE.consultarEmpresaPorId(request);
if (response.getResultCode() == 100) {
return response.getEmpresa();
}
I do not need to create the webservice, only the client that in this case will be my desktop program, however I will check better the links may be I have what I need
– jsantos1991
If your program needs to consume information from the webservice, you will at least have to integrate it into your application...rs#Xa;If my answers are useful, mark as correct! (Thank you!
– Dante
Yes has logic, only now I will test, as to mark as right do not worry...
– jsantos1991