• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query to an https server - Code sample?

 
M Burke
Ranch Hand
Posts: 406
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to call a secure server from our vendor service, pass it an XML-based buffer as a POST (format x-www-form-urlencoded), and gather up the response. I am familiar with the URL object, but it seems limited.

Code sample? Any gotha's?
[ December 04, 2006: Message edited by: M Burke ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The javax.net.ssl.HttpsUrlConnection class will help with this. The Java Almanac has some code snippets, but it works similar to java.net.HttpUrlConnection.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing you may find helpful. When I played with all this stuff I had to connect to service provider with a not CA signed sertificate. So I had to add my TrustManager which allowed such connections. Do not forget to comment this code out for production.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!