Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent Help needed!! calling a https url from java program and sending a soap envelope request

 
Candida Samuel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am trying to call a https url via a java main. I have to pass a Soap envelope request to the url and I am expecting a String response from the other end. I have the necessary keystore files.
I get the following error response:
Server returned HTTP response code: 415 for URL


Can any one provide with a java program?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
According to the W3 standard document, HTTP response code means:
The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.

Have you tried to run the client and server without HTTPS, that is, using plain HTTP?
If you are having problems setting up either plain SSL or SSL with mutual authentication in connection to web services, please have a look at my book that contains complete examples on how to do both: http://www.slideshare.net/krizsan/scdjws-5-study-notes-3085287
Best wishes!
 
Candida Samuel
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Thanks for your reply.I have tried using plain http url and it works well.Not sure, how to go about https url.

If you have a code piece where in you' re calling a https url via java, can you please share it.

Thanks,
Candida
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Candida Samuel wrote:If you have a code piece where in you' re calling a https url via java, can you please share it.

Check the book I gave a link to in my previous post!
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic