Hi, SMX ship CXF as jaxws impl OOTB, the JAXWSProperties you used here is metro specific, it even won't from the JAXWS specific, so the way you used here is hard to say "portable" ------------- Freeman(Yue) Fang
Red Hat, Inc. FuseSource is now part of Red Hat Web: http://fusesource.com | http://www.redhat.com/ Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: @Freeman小屋 On 2013-9-21, at 上午8:23, Marc wrote: > hello, > > I'm trying to write some a very portable library that I want to be able to > use inside of Servicemix but also distribute outside of Servicemix. > > The library I'm writing is using a JAX-WS Contract First WSDL. The WSDL and > JAXB code was built from WSDL2JAVA. > > I've written everything in Java using JAX-WS and no CXF. Things worked in > the first prototype now I've hit a wall. > > The problem has to do with the SSLSocketFactory and HostnameVerifier. > > Using JAX-WS I set those on my WSDL with the following code. > > *AuWSDLPortType port = auService.getAuService(); > BindingProvider bindingProvider = (BindingProvider)port; > > bindingProvider.getRequestContext().put(JAXWSProperties.SSL_SOCKET_FACTORY, > getCustomSocketFactory()); > bindingProvider.getRequestContext().put(JAXWSProperties.HOSTNAME_VERIFIER, > getCustomHostnameVerifier());* > > (in reality I'm not using JAXWSProperties but the strings i.e. > "com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory") > > The code works outside of servicemix but in Servicemix and I get a huge > stack trace with the following error: > > /"Cause by: sun.security.provider.certpath.SunCertPathBuilderException: > unable to find valid certification path to request target"/ > > Turning on javax.xml.debug=all shows me that my custom TrustStore (1 entry) > configured in getCustomSocketFactory() is never loaded and that instead the > default truststore (100+ entries) is loaded. > > JAXWSProperties don't exist in Servicemix and conversely CXF, which is the > code in Servicemix that is handling my JAX-WS endpoint. So what I'm trying > to figure out now is how do I write something that works both outside of > Servicemix and in Servicemix and only relies on the core Java libraries? So > using CXF HttpConduit would not be ideal because it would limit portability > by requiring CXF to use what is suppose to be a lightweight library. > > I was hoping that an equivalent string to JAXWProperties might exist in CXF > maybe? > Or maybe there is something I can do in my code to figure out if the > underlying WS implementation is Java core or CXF and switch between the two? > Or maybe there is a way I can tell Servicemix (from within the bundle) that > I would like to use the Java WSDL impl? > > I don't know what I don't know so I'm open to suggestions and approaches : ( > > > > -- > View this message in context: > http://servicemix.396122.n5.nabble.com/JAXWSProperties-in-Servicemix-tp5717833.html > Sent from the ServiceMix - User mailing list archive at Nabble.com.
