Last modified by Pascal Robert on 2009/03/17 14:18

Hide last authors
Ramsey Gurley 5.1 1 == WOWebServiceClient constructor hanging ==
2
Ramsey Gurley 6.1 3 It is possible to hang your WO app instance with the WOWebServiceClient constructor unless you set a connection timeout to something other than the java default. To do this, you need to set the command line flag
Ramsey Gurley 5.1 4
5 {{code}}
6 -Djava.net.connectiontimeout=30
7 {{/code}}
8
Ramsey Gurley 6.1 9 By default, the timeout is infinite. In this instance, you would be setting the timeout to 30 seconds. If you do not set a fixed time for the timeout, a refused connection attempt (caused by a non responsive web services server, for instance) will hang your application instance.
Ramsey Gurley 5.1 10
Pascal Robert 4.1 11 == SSL WebServices Problems ==
smmccraw 1.1 12
13 ~1. WOWebServiceClient class can't access to a secure HTTP Web service provider (WO 5.2.2):
14
15 Problem:
Ramsey Gurley 6.1 16 The com.webobjects.webservices.client.WOWebServiceClient class just throws exception like this one when it tries to read the WSDL from a secure HTTP Web service provider:
smmccraw 1.1 17
Pascal Robert 4.1 18 {{code}}
smmccraw 1.1 19
Pascal Robert 4.1 20 java.lang.IllegalArgumentException: Unable to open url:
21 https://localhost/cgi-bin/WebObjects/Test-Server.woa/ws/Test?wsdl
22 at com.webobjects.webservices.client.WOWebServiceClient.
23 initializeFromURL(WOWebServiceClient.java:72)
24 at com.webobjects.webservices.client.WOWebServiceClient.
25 <init>(WOWebServiceClient.java:59
smmccraw 1.1 26
Pascal Robert 4.1 27 {{/code}}
smmccraw 1.1 28
29 This problem doesn't seem related to self signed certificate, since I've performed tests with trusted certificate as well.
30
Pascal Robert 4.1 31 === Patrick Robinson ===
smmccraw 1.1 32
33 That's strange . . .
34
35 I had the same problem when I was trying to run both service and client on my development machine (which has only a self-signed cert), and specifying an HTTPS WSDL address. But after adding my cert to /Library/Java/Home/lib/security/cacerts:
36
Pascal Robert 4.1 37 {{code}}
smmccraw 1.1 38
Pascal Robert 4.1 39 cd /Library/Java/Home/lib/security
40 sudo keytool -import -keystore cacerts -alias myalias -file mycert.pem
smmccraw 1.1 41
Pascal Robert 4.1 42 {{/code}}
smmccraw 1.1 43
Pascal Robert 4.1 44 (The default password for the cacerts keystore is "changeit")
smmccraw 1.1 45
46 everything works fine.
47
48 I also had no trouble accessing either the WSDL or the service, via HTTPS, when the service was run on a system with a valid, trusted cert.
49
Pascal Robert 4.1 50 === Francis Labrie ===
smmccraw 1.1 51
Pascal Robert 4.1 52 It's finally not a real bug, thanks to Patrick Robinson and to the JAD tool. This exception is typically thrown when the server certificate is not trusted, i.e. the certificate is self-signed and not stored in the Java trusted keystore, or the hostname is not the same on the server and in the certificate, etc.
smmccraw 1.1 53
54 The problem is that the initializeFromURL() method of the com.webobjects.webservices.client.WOWebServiceClient class doesn't wrap and forward the catched exceptions, it only throws IllegalArgumentException with a simple " Unable to open url" or " Unable to create service from url" message, without any details.
55
Pascal Robert 8.1 56 To avoid such problem, just relax the Java security manager using code like one described here: [[How to Trust Any SSL Certificate>>doc:documentation.Home.Development Architecture.Web Services.Web Services-How to Trust Any SSL Certificate.WebHome]].
smmccraw 1.1 57
Pascal Robert 4.1 58 === to Apple Documentation ===
smmccraw 1.1 59
Ramsey Gurley 6.1 60 [[http:~~/~~/developer.apple.com/documentation/WebObjects/Web_Services/Web_Services/chapter_4_section_3.html>>url:http://developer.apple.com/documentation/WebObjects/Web_Services/Web_Services/chapter_4_section_3.html||shape="rect"]]