Skip to main content
  1. Posts/

JAX-WS with Custom SSLSocketFactory

It’s very easy to configure custom SSLSocketFactory for JAX-WS web-service: just specify custom property referring to SSLSocketFactory bean. But there is a nuance…

In SpringFramework you may setup web service port with following XML configuration:

<bean id="myPort" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
    <property name="serviceInterface" value="com.example.ServicePortInterface"/>
    <property name="wsdlDocumentResource" value="classpath:wsdl/MyService.wsdl"/>
    <property name="namespaceUri" value="urn:MyServer"/>
    <property name="serviceName" value="MyServerService"/>
    <property name="endpointAddress" value="${my.service.url}"/>
    <property name="customProperties">
        <map key-type="java.lang.String">
            <entry key=""

<!--  My bean implements -->
<bean id="mySslSocketFactoryBean" .../>

The code above will work if you are using JAX-WS reference implementation but will not work with JAX-WS bundled in Oracle JDK. For that case you need to set a custom property named "".

That’s confusing, but you should use a property name defined in the JAXWSProperties class of JAX-WS implementation of your choice. For example:

  • – if you’re using JAXWS-RI implementation;
  • – for Oracle JDK implementation;
  • weblogic.wsee.jaxws.JAXWSProperties.SSL_SOCKET_FACTORY – for WebLogic server’s implementation. …

So find a JAXWSProperties and use a value of constant SSL_SOCKET_FACTORY in JAX-WS binding custom properties.