Insertion into the database through Webservice

3

Good evening,

I know very little about Webservice . And, through tutorials, I was able to create one. Content has been taken from this site: Creating Web- Service

The query is done successfully, but now I need the user to enter some information in the Webservice page, and this information will be inserted into the Postgres database.

How do I? It's possible? Do I need to use any other technology?

I'm lost: /

    
asked by anonymous 11.03.2015 / 01:13

2 answers

2

I see that you need to have a sound knowledge of what exactly a Web Service is, what are your purposes.

I noticed that you want to know ways to make the "Web Service page" allow the user to enter information and you will register the data.

There is no Web Service page.

There are Web Service Operations.

In this case, what you want is add a new operation that allows a client / consumer (which, yes, can be an application that provides an interface for a user to type) new information.

I recommend that you have a solid understanding of what a Web Service is.

Here are some links to get you started:

link

link

link (this last one from Oracle has excellent explanations)

How much does your question really matter - Add this method / operation to the same class that implements WebService

@WebMethod (operationName="addMunicipality") public String searchMunicipality (@WebParam (name="municipality") String town) {    // Other logic accessing methods to insert in Bank of Daddos }

Deploy your WebService again and this service will be available soon.

For consumption, if you want to write a Java client, use the wsimport

link

This is an extensive subject and rich in detail, you can hardly learn everything with my answer, so study more, do not just follow tutorials, they are important, but understand the purposes behind.

    
04.06.2015 / 05:00
0

You will have to create a client for a Web Service, NetBeans will help you, so follow the link below:

link

After creating the client, implement some Web interface (Servlet or JSP) to use the client

    
19.03.2015 / 23:43