public void updateWsdl(Bus b, String wsdlLocation) { updateWsdlExtensors(b, wsdlLocation, brokerUrl1, getEncodedBrokerURL()); }
public static void updateWsdlExtensors(Bus bus, String wsdlLocation, String url, String encodedUrl) { try { if (encodedUrl == null) { encodedUrl = url; } if (bus == null) { bus = BusFactory.getThreadDefaultBus(); } Definition def = bus.getExtension(WSDLManager.class) .getDefinition(wsdlLocation); Map<?, ?> map = def.getAllServices(); for (Object o : map.values()) { Service service = (Service)o; Map<?, ?> ports = service.getPorts(); adjustExtensibilityElements(service.getExtensibilityElements(), url, encodedUrl); for (Object p : ports.values()) { Port port = (Port)p; adjustExtensibilityElements(port.getExtensibilityElements(), url, encodedUrl); adjustExtensibilityElements(port.getBinding().getExtensibilityElements(), url, encodedUrl); } } } catch (Exception e) { e.printStackTrace(); } }
protected void initDefaultServant() { servant = new NumberImpl(); String wsdlLocation = "testutils/factory_pattern.wsdl"; String bindingId = null; EndpointImpl ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation); ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort")); ep.publish(getServantAddressRoot()); endpoints.add(ep); templateEpr = ep.getServer().getDestination().getAddress(); // jms port EmbeddedJMSBrokerLauncher.updateWsdlExtensors(bus, wsdlLocation); ep = new EndpointImpl(bus, servant, bindingId, wsdlLocation); ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPortJMS")); ep.setAddress("jms:jndi:dynamicQueues/test.cxf.factory_pattern.queue"); ep.publish(); ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor()); ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor()); endpoints.add(ep); }
EmbeddedJMSBrokerLauncher.updateWsdlExtensors(BusFactory.getDefaultBus(), s); NumberService numService = new NumberService();