aspose file tools*
The moose likes Web Services and the fly likes Sending Soap requests thru Https Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Sending Soap requests thru Https" Watch "Sending Soap requests thru Https" New topic
Author

Sending Soap requests thru Https

vignesh bala
Greenhorn

Joined: Aug 19, 2006
Posts: 28

Hi all,
I am trying to access a web service which is running in SSL (Https). The problem is the message sending fails ant its throwing "com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Message send failed". The Code fragment is shown below:



I don't know whether I can invoke a Https URL as shown above. Please clarify me. I am also giving my error log below:
Added SSL_PROVIDER com.sun.net.ssl.internal.ssl.Provider
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(DashoA12275)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.doConnect(DashoA12275)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.protocol.https.HttpsClient.<init>(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.a(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.a(DashoA12275)
at sun.net.www.protocol.https.HttpsClient.a(DashoA12275)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.plainConnect(DashoA12275)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA12275)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:569)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(DashoA12275)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:263)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:151)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
at STest.main(STest.java:36)
Oct 30, 2006 3:07:36 PM com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection post
SEVERE: SAAJ0009: Message send failed

Rgds,
Vignesh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
This introduction to SAAJ talks about what needs to be done to connect to a WS over HTTPS (on the last few pages). There are few things that need to be set up in order for it to work.


Ping & DNS - my free Android networking tools app
vignesh bala
Greenhorn

Joined: Aug 19, 2006
Posts: 28

Thanks Ulf,
I had it done. actually there was some problem with the firewall.
Rgds,
Vignesh
krishnamoorthy kitcha
Ranch Hand

Joined: Feb 04, 2006
Posts: 96
Hi all,

I am also facing the saming problem while invoking the webservices using weblogic server 8.1 and service pack 6.0 ,

Please find out following errors showed by the server (Using the Secure protocol example https://localhost:9443/Webservices/Request)

java.lang.NullPointerException
at weblogic.security.SSL.SSLCertificate.verify(SSLCertificate.java:235)
at weblogic.security.SSL.SSLCertificate.input(SSLCertificate.java:116)
at weblogic.security.SSL.Handshake.input(Handshake.java:121)
at weblogic.security.SSL.SSLSocket.getHandshake(SSLSocket.java:1117)
at weblogic.security.SSL.SSLSocket.clientInit(SSLSocket.java:432)
at weblogic.security.SSL.SSLSocket.initialize(SSLSocket.java:276)
at weblogic.security.SSL.SSLSocket.<init>(SSLSocket.java:222)
at weblogic.security.SSL.SSLSocketFactory.createSocket(SSLSocketFactory.java:213)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:238)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java:389)
at weblogic.net.http.HttpsClient.<init>(HttpsClient.java:209)
at weblogic.net.http.HttpClient.New(HttpClient.java:228)
at weblogic.net.http.HttpsURLConnection.getHttpClient(HttpsURLConnection.java:246)
at weblogic.net.http.HttpsURLConnection.connect(HttpsURLConnection.java:217)
at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:189)
at weblogic.webservice.binding.http11.Http11ClientBinding.send(Http11ClientBinding.java:427)
at weblogic.webservice.core.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:57)

Please advise me, How will I solve this issue ?

I am expecting your valuable comments.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sending Soap requests thru Https