• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call a webservice (cfm) from a servlet?  RSS feed

 
Leticia Barbalho
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

I need to call an webservice that is in an address like this: http://www.address.com/service.cfm

I used to use it in a jsp, in a form, doing something like: <form action="http://www.address.com/service.cfm"> ...

The problem is that now I cannot use a jsp. I want to call it from the servlet (sending and receiving the parameters).. without any jsp.

Can someone show me how?

thanks
 
Scott Dunbar
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general I tend to use Apache Axis for my client and server webservice needs.

If this is not a true web service (XML/SOAP over HTTP) then you might want to consider using Apache Commons HttpClient to be the client in a web transaction.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Investigate the java.net.URL and java.net.URLConnection classes.

Or make it easy on yourself and check into HttpUnit.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott is right on the money. If you don't want to get into Axis, how about a SAAJ client?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!