How do I set the timeout for a JAX-WS webservice client?

I know this is old and answered elsewhere but hopefully this closes this down. I’m not sure why you would want to download the WSDL dynamically but the system properties: sun.net.client.defaultConnectTimeout (default: -1 (forever)) sun.net.client.defaultReadTimeout (default: -1 (forever)) should apply to all reads and connects using HttpURLConnection which JAX-WS uses. This should solve your problem … Read more

JAX-WS – Map Exceptions to faults

Did you try to annotate your exception with @WebFault? Also, do you implement getFaultInfo()? EDIT: I realize my answer was maybe not detailed enough. As reminded in this thread (for example): The JAX-WS 2.0 specification demands that the exception annotated with @WebFault must have two constructors and one method [getter to obtain the fault information]: … Read more

JAX-WS = When Apache CXF is installed it “steals” default JDK JAX-WS implementation, how to solve?

Apache CXF (cxf-rt-frontend-jaxws-*.jar to be precise) registers itself as a JAX-WS provider in the JVM. Inside the aforementioned JAR there is a file named: /META-INF/services/javax.xml.ws.spi.Provider with the following contents: org.apache.cxf.jaxws.spi.ProviderImpl If you now look at javax.xml.ws.spi.FactoryFinder#find method you will discover that JDK searches the CLASSPATH for the presence of javax.xml.ws.spi.Provider file and falls back to … Read more

java: Rpc/encoded wsdls are not supported in JAXWS 2.0

RPC/encoded is a vestige from before SOAP objects were defined with XML Schema. It’s not widely supported anymore. You will need to generate the stubs using Apache Axis 1.0, which is from the same era. java org.apache.axis.wsdl.WSDL2Java http://someurl?WSDL You will need the following jars or equivalents in the -cp classpath param: axis-1.4.jar commons-logging-1.1.ja commons-discovery-0.2.jar jaxrpc-1.1.jar … Read more

How to programmatically set the SSLContext of a JAX-WS client?

This one was a hard nut to crack, so for the record: To solve this, it required a custom KeyManager and a SSLSocketFactory that uses this custom KeyManager to access the separated KeyStore. I found the base code for this KeyStore and SSLFactory on this excellent blog entry: how-to-dynamically-select-a-certificate-alias-when-invoking-web-services Then, the specialized SSLSocketFactory needs to … Read more