• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass data from servlet to web services

 
iza izyani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently doing a project-Web Services-JAX-WS in Java. And I’m using Servlet as the Web Service Client. In my web service, I need to insert a data to database-which the data should be pass from the user.

For the time being, I hard-coded all the input value. And it works successfully.


My problem is, when I want to have user input data to insert to my database.


I already create a JSP Page, to pass the data to my Servlet (I’m using request.getParameter). But, I don’t know or have no idea, how I’m going to pass the data from servlet to the web service, so when web service receive the information, it can insert the data to the database.


Do you have any idea where I can start to work on how to solve it?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

JAX-WS comes with a tool to create Java client classes for a given WSDL called "wsimport". You can integrate the classes generated by that tool with your servlet code.
 
iza izyani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Welcome to JavaRanch.

JAX-WS comes with a tool to create Java client classes for a given WSDL called "wsimport". You can integrate the classes generated by that tool with your servlet code.


can you explain or guide more further.. this is the first time i'm doing the web services programming.. and i'm using netbean as the IDE....

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WS are a big subject that can't be explained in a forum like this. Choose a JAX-WS stack to use (either Apache Axis2 or Metro), both come with plenty of sample code and have much introductory material on their respective web sites.

I advise not to use an IDE when you start out using WS; they hide much of the detail that you need to understand if you want to become a proficient WS developer.
 
Vinod K Singh
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
iza izyani wrote:can you explain or guide more further.. this is the first time i'm doing the web services programming.. and i'm using netbean as the IDE....


See if this Building JAX-WS Web Service helps you in anyway.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic