cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dev <devajyot...@gmail.com>
Subject Re: Question regarding SOAPBody and precreated XML payload
Date Thu, 21 Jul 2011 21:05:38 GMT
Thanks a bunch Daniel your suggestion helped  , I do not get that error
however now I am getting the following error: -

aused by: java.io.IOException: The https URL hostname does not match the
Common Name (CN) on the server certificate.  To disable this check (NOT
recommended for production) set the CXF client TLS configuration property
"disableCNCheck" to true.

I am using the following code: -

		/*
		 * Provide handle to key store for SSL hand shake.
		 */
		System.setProperty("javax.net.ssl.keyStore", "truststore.jks");
		System.setProperty("javax.net.ssl.keyStorePassword", "xxx");
		System.setProperty("javax.net.ssl.trustStore", "truststore.jks");
		System.setProperty("javax.net.ssl.trustStorePassword", "xxx");
		
		
		HostnameVerifier hv = new HostnameVerifier() {
			public boolean verify(String urlHostName, SSLSession session) {
				System.out.println("Warning: URL Host: " + urlHostName
						+ " vs. " + session.getPeerHost());
				return true;
			}
		};
		HttpsURLConnection.setDefaultHostnameVerifier(hv);


This is allowing me to access WSDL from the server and get the service name
and port name using the following API, without the above piece of code I was
getting IOException regarding URL mismatch between certificate all the time:
-

WSDLServiceFactory sf = new WSDLServiceFactory(CXFBusFactory
				.getThreadDefaultBus(), url);

		Definition definition = sf.getDefinition();

		List<ServiceInfo> services;
		services = new com.luminant.relay.app.xfs.ws.WSDLServiceBuilder(
				CXFBusFactory.getThreadDefaultBus()).buildServices(definition);


However when i am actually sending the SOAP request to the server I am
running into the error as I mentioned earlier. The error message seems to
hint the workaround, but with the APIs I am using I don't know if it will
work. Any idea? 

--
View this message in context: http://cxf.547215.n5.nabble.com/Question-regarding-SOAPBody-and-precreated-XML-payload-tp4620842p4621006.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Mime
View raw message