473,399 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

SOAP request from java returning Certificate exceptions

I'm sending the following SOAP request to a webservice (I've had to star out some parts of it for privacy purposes):

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  3. <soap-env:Header/><soap-env:Body>
  4. <GetAppList xmlns="https://***.***.***.***/***/***.asmx?op=***">
  5. <requestId>1</requestId>
  6. <laNumber>5</laNumber>
  7. <hashCode>*******</hashCode>
  8. </GetAppList>
  9. </soap-env:Body>
  10. </soap-env:Envelope>
The following is a stack trace of the error that I am getting and cannot work out why I am getting it, could somebody please help?

Expand|Select|Wrap|Line Numbers
  1. javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Could not find trusted certificate
  2.  
  3.     at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
  4.  
  5.     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
  6.  
  7.     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
  8.  
  9.     at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
  10.  
  11.     at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA6275)
  12.  
  13.     at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA6275)
  14.  
  15.     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
  16.  
  17.     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
  18.  
  19.     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
  20.  
  21.     at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
  22.  
  23.     at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
  24.  
  25.     at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:528)
  26.  
  27.     at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(DashoA6275)
  28.  
  29.     at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:246)
  30.  
  31.     at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:141)
  32.  
  33.     at java.security.AccessController.doPrivileged(Native Method)
  34.  
  35.     at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:114)
  36.  
  37.     at com.sx3.wiz.iplan.inspect.client.PlanningPortalClient$22.construct(PlanningPortalClient.java:870)
  38.  
  39.     at com.sx3.wiz.iplan.inspect.client.SwingWorker$2.run(SwingWorker.java:110)
  40.  
  41.     at java.lang.Thread.run(Thread.java:536)

I'm pretty new to SOAP although I think it might have something to do with the fact that the xml it is using is encapsulated using <soap-env> instead of <soap12:Envelope>. Would that cause an error or should it matter?
Sep 24 '08 #1
1 3023
Have an update.

I've found a forum post where a guy posts the following, would this help? Not sure what class to use:

Greetings,

The problem lies in the default trustStore provided with Java ( jdk1.4/jre/lib/security/cacerts).
Heres the steps I took to get fix this problem, they should work for you.
First, export the certificate into a .cer file. (With internet explorer, goto tools->internet options->content->certificates, and you can export them). Once you have the .cer file, you need to place it in a store that java can use...
In my case, the only certificate I wanted trusted was the one I provided in the .cer file, so using keytool (provided with java), I imported the certificate to a new store:

keytool -import -alias <insert alias here> -file <insert .cer filename> -keystore <storename here>

If you are using a new store name, it should create a file in the current directory with the <storename> you entered. Now, to make the trustManager look in this store during initialization with your application, you can need to set the javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword properties (either during runtime, or at the command prompt)

At the command prompt, it'd look like this:

java -Djavax.net.ssl.trustStore=<storename> -Djavax.net.ssl.trustStorePassword=<password>

And then of course followed by the class you wish to execute-
Hope this helps

-Ryan
Sep 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matt Wood | last post by:
Hi, I have written a Web Service for a customer which expects a SOAP message with Document/Literal encoding, and uses RoutingStyle=SoapServiceRoutingStyle.RequestElement to route the SOAP body...
3
by: JRey | last post by:
Does .Net generate the classes for Faults when they are specified in the WSDL. I tried defining them and then generating a proxy, and it did not appear to do it. On the Java side it did generate...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
1
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom...
0
by: jaywak | last post by:
Just tried running some code on Linux (2.4.21-32.0.1.EL and Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)) and Windows XPSP2 (with Java HotSpot(TM) Client VM (build...
1
by: novicedlh | last post by:
Hello, I am creating a webservice that collects user information and stores it in a database. Since the user information contains sensitive data like SSN I am planning to use WS-Security (WSE...
0
by: broersen | last post by:
Hello, Does someone know how to create manually the header for an SOAP message, without having an WSDL? I also use an X509 certificate for connecting to the webservice. Can anyone help me to get...
0
by: broersen | last post by:
Hello, Does someone know how to create manually the header for an SOAP message, without having an WSDL? I also use an X509 certificate for connecting to the webservice. Can anyone help me to get...
1
by: dalh | last post by:
Hi all, I'm developing an asp.net app that connect to a webservice. - I've installed an P7k certificate in the IIS-website configuration. When running my code, I have following error:...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.