File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I call doPost?

 
M Jay
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am required to use a servlet which has an implementation for both doGet and doPost. However I am required to call the doPost method by "posting" an xml file(or SOAP message). Any idea how I can do that? some code illustration will be greatly appreciated.
 
Vicky Pandya
Ranch Hand
Posts: 148
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can call doPost from doGet() if that's what you are asking.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What mechanism are you using to initiate the request?
 
M Jay
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically I have a set of parameters that I need to pass to a servlet. Previously I was passing them by calling the servlet like

this "http://localhost:8080/.../Servlet?param1=?¶m2=?"

So I assume the above calls the doGet method of the servlet.

Now I am required to implement a doPost method for the same servlet, which would receive those parameters in an XML file. So I am sending the attributes via SOAP to the doPost. This is the code for the class that initiates the request:

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic