Skip to main content

Enable GZIP and HTTPS on JAX-WS

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2010-01-12
Points: 0


is it possible to publish a Webservice with GZIP and HTTPS when I have no JBoss or Glassfish?

I have to start the Webservice with

Endpoint.publish(address, this);

The endpoints are started and stopped dynamically.

On ClientSide I have found this sollution:

OTS2WebServices ws = service.getPort(pQname, OTS2WebServices.class);

Map requestContext = ((BindingProvider)ws).getRequestContext();
Map<String, List<String>> httpHeaders = new HashMap<String, List<String>>();
httpHeaders.put("Accept-Encoding", Collections.singletonList("gzip, deflate"));
requestContext.put(MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);

Are there properties for the endpoint which I have to set?
How can I set the server-certificate? Is it possible to do this during runtime?

Thank you,