/** * Create the actual Endpoint instance. * @param bean the service object to wrap * @return the Endpoint instance * @see Endpoint#create(Object) * @see Endpoint#create(String, Object) */ protected Endpoint createEndpoint(Object bean) { return (this.endpointFeatures != null ? Endpoint.create(this.bindingType, bean, this.endpointFeatures) : Endpoint.create(this.bindingType, bean)); }
/** * Create the actual Endpoint instance. * @param bean the service object to wrap * @return the Endpoint instance * @see Endpoint#create(Object) * @see Endpoint#create(String, Object) */ protected Endpoint createEndpoint(Object bean) { return (this.endpointFeatures != null ? Endpoint.create(this.bindingType, bean, this.endpointFeatures) : Endpoint.create(this.bindingType, bean)); }
import java.io.*; import javax.xml.ws.*; import javax.xml.ws.http.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; @WebServiceProvider @ServiceMode(value = Service.Mode.PAYLOAD) public class Server implements Provider<Source> { public Source invoke(Source request) { return new StreamSource(new StringReader("<p>Hello There!</p>")); } public static void main(String[] args) throws InterruptedException { String address = "http://127.0.0.1:8080/"; Endpoint.create(HTTPBinding.HTTP_BINDING, new Server()).publish(address); System.out.println("Service running at " + address); System.out.println("Type [CTRL]+[C] to quit!"); Thread.sleep(Long.MAX_VALUE); } }
/** * Create the actual Endpoint instance. * @param bean the service object to wrap * @return the Endpoint instance * @see Endpoint#create(Object) * @see Endpoint#create(String, Object) */ protected Endpoint createEndpoint(Object bean) { return (this.endpointFeatures != null ? Endpoint.create(this.bindingType, bean, this.endpointFeatures) : Endpoint.create(this.bindingType, bean)); }
public void publish(String url) { Endpoint ep = Endpoint.create(HTTPBinding.HTTP_BINDING, this); ep.publish(url); }
protected Server() throws Exception { System.out.println("Starting Server"); Object implementor = new GreeterImpl(); String address = "http://localhost:8080/services/InterceptorExample"; Endpoint endpoint = Endpoint.create(implementor); // Add the DemoInterceptor's to print the contents DemoInterceptor.addInterceptors(((EndpointImpl)endpoint).getServer().getEndpoint().getBinding()); endpoint.publish(address); }
@SuppressWarnings("unchecked") @Override public LocalWebService<?> coerce(CoercionTarget type, String value) { if (!value.equals("local://")) throw new IllegalArgumentException("Expected a value of 'local://', the path will be derived"); Class<?> contract = type.getComponentCoercionTypes()[0].getType(); Object implementor = finder.find(contract); String address = value + "sticky/"+ namingStrategy.deriveAddress(implementor, contract); Endpoint endpoint = Endpoint.create(implementor); endpoint.publish(address); Object client = webServiceCoercion.coerce(type.getComponentCoercionTypes()[0], address); return new LocalWebService(endpoint, client); }
protected void run() { Object implementor = new HWDOMSourcePayloadXMLBindingProvider(); Endpoint ep = Endpoint.create(implementor); Map<String, Object> map = new HashMap<>(); map.put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.TRUE); ep.setProperties(map); ep.publish(ADDRESS); }
protected void run() { Object implementor = new GreeterImplNoWsdl(); String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort"; Endpoint ep = Endpoint.create(implementor); Map<String, Object> props = new HashMap<>(); props.put(WSDLGetUtils.WSDL_CREATE_IMPORTS, Boolean.TRUE); ep.setProperties(props); ep.publish(address); }
public static void publish(String address, Object impl) { EndpointImpl ep = (EndpointImpl)Endpoint.create(impl); ep.setBus(bus); ep.getFeatures().add(cff); ep.publish(address); }
private void doPublish(String url, Object obj) { Endpoint ep = Endpoint.create(obj); ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback()); ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES, "bob.properties"); if (streaming) { ep.getProperties().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true"); } ep.publish(url); }
private void doPublish(String url, Object obj) { Endpoint ep = Endpoint.create(obj); ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback()); ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES, "restricted/bob.properties"); if (streaming) { ep.getProperties().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true"); } ep.publish(url); }
protected void run() { Object implementor; String address; implementor = new GreeterImpl(); address = "ws://localhost:" + PORT + "/SoapContext/SoapPort"; Endpoint ep = Endpoint.publish(address, implementor); eps.add(ep); //publish port with soap12 binding address = "ws://localhost:" + PORT + "/SoapContext/SoapPort"; EndpointImpl e = (EndpointImpl) Endpoint.create(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING, new Greeter12Impl()); e.publish(address); eps.add(e); }
protected void run() { String address; Object implementor = new RPCLitGreeterImpl(); address = "http://localhost:" + PORT + "/SOAPServiceRPCLit/SoapPort"; ep = Endpoint.create(implementor); URL wsdl = getClass().getResource(wsdlLocation); ((EndpointImpl)ep).setWsdlLocation(wsdl.toString()); ((EndpointImpl)ep).getInInterceptors().add(new LoggingInInterceptor()); ((EndpointImpl)ep).getOutInterceptors().add(new LoggingOutInterceptor()); ep.publish(address); }
protected void run() { Object implementor = new HWSoapMessageDocProvider(); Endpoint ep = Endpoint.create(implementor); Map<String, Object> map = new HashMap<>(); map.put(Message.SCHEMA_VALIDATION_ENABLED, Boolean.TRUE); ep.setProperties(map); ((EndpointImpl)ep).getInInterceptors().add(new LoggingInInterceptor()); ((EndpointImpl)ep).getOutInterceptors().add(new LoggingOutInterceptor()); ep.publish(ADDRESS); }
protected void run() { TestProvider implementor = new TestProvider(); Endpoint ep = Endpoint.create(implementor); ((EndpointImpl)ep).setWsdlLocation("wsdl_systest/mtom_provider_validate.wsdl"); ep.publish("http://localhost:" + PORT + "/mtom/provider"); }
public static Endpoint setupCommandServiceEndpoint( String address, CommandWebService webServiceImpl ) { EndpointImpl ep = (EndpointImpl) Endpoint.create(webServiceImpl); ep.setAddress(address); ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new TestServerPasswordCallback()); ep.publish(); return ep; }
@Test public void testGetBinding() throws Exception { Endpoint ep = Endpoint.create("http://schemas.xmlsoap.org/wsdl/soap/http", new HelloImpl()); assertTrue(ep.getBinding() instanceof SOAPBinding); }
@BeforeClass public static void startServers() throws Exception { startBusAndJMS(ProviderJMSContinuationTest.class); Object implementor = new HWSoapMessageDocProvider(); String address = "jms:queue:test.jmstransport.text?replyToQueueName=test.jmstransport.text.reply"; EndpointImpl ep = (EndpointImpl)Endpoint.create(implementor); ep.getInInterceptors().add(new IncomingMessageCounterInterceptor()); ep.setBus(bus); ep.getFeatures().add(cff); ep.publish(address); }
@BeforeClass public static void startServers() throws Exception { startBusAndJMS(SoapJmsSpecTest.class); publish("jms:queue:test.cxf.jmstransport.queue2", new GreeterSpecImpl()); publish("jms:queue:test.cxf.jmstransport.queue5", new GreeterSpecWithPortError()); EndpointImpl ep = (EndpointImpl)Endpoint.create(null, new GreeterSpecImpl()); ep.setBus(bus); ep.getFeatures().add(new GZIPFeature()); ep.getFeatures().add(cff); ep.publish("jms:queue:test.cxf.jmstransport.queue6"); }