protected Server() throws Exception { System.out.println("Starting Server"); Endpoint ep = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new DoubleItPortTypeImpl()); Map<String, Object> properties = new HashMap<String, Object>(); properties.put("ws-security.callback-handler", "service.ServiceKeystorePasswordCallback"); properties.put("ws-security.signature.properties", "serviceKeystore.properties"); properties.put( Endpoint.WSDL_PORT, new QName("http://www.example.org/contract/DoubleIt", "DoubleItPort")); ep.setProperties(properties); ep.publish("http://localhost:9000/doubleit/services/doubleit"); }
/** * Creates and publishes a messaging service endpoint at the specified address. * * @param service The service that should be started at <var>address</var>. * @return The newly created endpoint. */ public static Endpoint publish(MessagingService service) { // service = new RequestTracer(new MessagingServiceImpl(service)); service = new MessagingServiceImpl(service); Endpoint endpoint = Endpoint.create(service); endpoint.setProperties( new HashMap<String, Object>() { { put( Endpoint.WSDL_PORT, new QName(MessagingService.NAMESPACE, MessagingService.PORT_NAME)); put( Endpoint.WSDL_SERVICE, new QName(MessagingService.NAMESPACE, MessagingService.SERVICE_NAME)); } }); String address = getServiceUrl(); endpoint.publish(address); logger.log(Level.INFO, "Listening at {0}…", address); return endpoint; }