aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes url connection using https? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "url connection using https?" Watch "url connection using https?" New topic
Author

url connection using https?

sujit menon
Greenhorn

Joined: Nov 12, 2005
Posts: 7
hi guys,

i have josso integrated web applications running on tomcat/apache web server.
i want to connect from one application java class to another servlet residing in another web application using url connection in https.
but dont know neither does it work nor does it throw any exception?
this is what i gave.

URL servletURL = new URL( connectionURL );
URLConnection servletConnection = servletURL.openConnection( );
servletConnection.setDoOutput( true );
servletConnection.setUseCaches( false );
InputStream in = servletConnection.getInputStream( );
StringBuffer response = new StringBuffer( );
int chr;

while( ( chr = in.read( ) ) != -1 ) {
response.append( ( char ) chr );
}

in.close( );
should i define it explicitely for https?
can someone help me on this?

thanks in advance
sujit
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
What does "it does not work" mean? What do you expect to happen, and what is actually happening?


Ping & DNS - my free Android networking tools app
sujit menon
Greenhorn

Joined: Nov 12, 2005
Posts: 7
sorry for not stating what should happen.
The problem is its not getting submitted to a servlet. URLConnection is code is there in WAR file. And the servlet resides in another war file.
Its not even going to the servlet. And not no exception ios getting thrown in the URLConnection implemented class
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
You should tell more about a servlet you'd like to invoke. Does it require get or post? Does it require any authentication? Did you use https based URLs?


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
sujit menon
Greenhorn

Joined: Nov 12, 2005
Posts: 7
the servlet which i need to invoke will get parameter from the request & reply back with a status.it does operation like insertion to database.it all is ok it will return success.


yes our whole application is https.i did specify authentications like truststore and password.
will it block the url connection?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url connection using https?