Changes for page Web Services-Web Service Consumer
Last modified by Pascal Robert on 2009/03/17 14:18
From version 2.1
edited by smmccraw
on 2007/07/08 09:46
on 2007/07/08 09:46
Change comment:
There is no comment for this version
To version 5.1
edited by Ramsey Gurley
on 2009/03/17 14:18
on 2009/03/17 14:18
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Programming__WebObjects-WebServices-Web Service Consumer1 +Web Services-Web Service Consumer - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. smmccraw1 +XWiki.ramsey - Content
-
... ... @@ -1,52 +1,60 @@ 1 -== SSLWebServices Problems ==1 +== WOWebServiceClient constructor hanging == 2 2 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 4 + 5 +{{code}} 6 +-Djava.net.connectiontimeout=30 7 +{{/code}} 8 + 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. 10 + 11 +== SSL WebServices Problems == 12 + 3 3 ~1. WOWebServiceClient class can't access to a secure HTTP Web service provider (WO 5.2.2): 4 4 5 5 Problem: 6 6 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: 7 7 8 -{{ panel}}18 +{{code}} 9 9 10 - 11 - 12 - 13 - 14 - 15 - )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 16 16 17 -{{/ panel}}27 +{{/code}} 18 18 19 19 This problem doesn't seem related to self signed certificate, since I've performed tests with trusted certificate as well. 20 20 21 -=== Patrick Robinson 31 +=== Patrick Robinson === 22 22 23 23 That's strange . . . 24 24 25 25 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: 26 26 27 -{{ panel}}37 +{{code}} 28 28 29 - 30 - 39 + cd /Library/Java/Home/lib/security 40 + sudo keytool -import -keystore cacerts -alias myalias -file mycert.pem 31 31 32 -{{/ panel}}42 +{{/code}} 33 33 34 - 44 +(The default password for the cacerts keystore is "changeit") 35 35 36 36 everything works fine. 37 37 38 38 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. 39 39 40 -=== Francis Labrie 50 +=== Francis Labrie === 41 41 42 -It's finally not a real bug, thanks to PatrickRobinson 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. 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. 43 43 44 44 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. 45 45 46 -To avoid such problem, just relax the Java security manager using code like one described here: [[How to Trust Any SSL Certificate>> Programming__WebObjects-WebServices-How to Trust Any SSL Certificate]].56 +To avoid such problem, just relax the Java security manager using code like one described here: [[How to Trust Any SSL Certificate>>Web Services-How to Trust Any SSL Certificate]]. 47 47 48 -=== to Apple Documentation 58 +=== to Apple Documentation === 49 49 50 -http:~/~/developer.apple.com/documentation/WebObjects/Web_Services/Web_Services/chapter_4_section_3.html 51 - 52 -Category:WebObjects 60 +[[http://developer.apple.com/documentation/WebObjects/Web_Services/Web_Services/chapter_4_section_3.html]]