|
I have a web
service running on Weblogic 6.1 that is configured to =
require SSL. I can successfully hit the WSDL and web service URI using = https from my IE browser. When I try to invoke the web service from a = standalone Java client (following the sample at = http://ws.apache.org/soap/docs/install/FAQ_Tomcat_SOAP_SSL.html), I = receive the following error: *** Exception *** : [SOAPException: faultCode=3DSOAP-ENV:Client; = msg=3DError opening socket: java.lang.IllegalStateException: Not enough = cryptography available to enable a cipher suite!; = targetException=3Djava.lang.IllegalArgumentException: Error opening = socket: java.lang.IllegalStateException: Not enough cryptography = available to enable a cipher suite!] at = org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection= .java:354) at org.apache.soap.rpc.Call.invoke(Call.java:248) at = apacheRPCWeatherClientWSSSL.main(apacheRPCWeatherClientWSSSL.java:63) I have been troubleshooting this for several hours with no success. Any = help is greatly appreciated. Thanks....
Kevin
And here is the code: import java.io.*; import java.net.*; import java.util.*; import java.security.Security; import javax.net.ssl.SSLSocketFactory; import org.apache.soap.*; import org.apache.soap.rpc.*; /** * @author SpraguK * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class apacheRPCWeatherClientWSSSL { /** *=20 */ public apacheRPCWeatherClientWSSSL() { super(); // TODO Auto-generated constructor stub } =20 public static void main (String[] args) { =20 try { =20 // Set the location of the certficate store housing the key material. System.setProperty("javax.net.ssl.truststore", = "c:\\bea61sp5\\wlserver6.1\\config\\TPASWEBDEV\\client.keystore"); =20 =20 // Use Sun's implementation of a URL handler that supports https. System.setProperty("java.protocol.handler.pkgs", = "com.sun.net.ssl.internal.www.protocol"); =20 // Dynamically register Sun's SSL provider Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); =20 // Whew, after all that, we can finally use https in the URL URL url ="" new URL ="">("https://PHI17082FOPSDEV:443/tpasWeather1.0/weatherService1.0"); String service =3D "urn:weather"; String zipCode =3D "19311"; Call call =3D new Call (); call.setTargetObjectURI (service); call.setMethodName ("getTemp"); call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); Vector params =3D new Vector (); params.addElement (new Parameter("string", String.class, zipCode, = null)); call.setParams(params); Response resp =3D call.invoke (url, "" ); if (resp.generatedFault ()) { Fault fault =3D resp.getFault (); System.out.println("Generated fault: " + fault); } else { Parameter result =3D resp.getReturnValue (); System.out.println ( result.getValue() ); } =20 } catch (Exception e) { System.out.println("*** Exception *** : "+getStackTraceAsString(e)); } } =20 public static String getStackTraceAsString(Throwable e) { ByteArrayOutputStream ostr =3D new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(ostr)); return(ostr.toString()); } } |
