本文整理汇总了Java中javax.xml.ws.Endpoint.publish方法的典型用法代码示例。如果您正苦于以下问题:Java Endpoint.publish方法的具体用法?Java Endpoint.publish怎么用?Java Endpoint.publish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.ws.Endpoint
的用法示例。
在下文中一共展示了Endpoint.publish方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
// find a free port
ServerSocket ss = new ServerSocket(0);
int port = ss.getLocalPort();
ss.close();
Endpoint endPoint1 = null;
Endpoint endPoint2 = null;
try {
endPoint1 = Endpoint.publish("http://0.0.0.0:" + port + "/method1",
new Method1());
endPoint2 = Endpoint.publish("http://0.0.0.0:" + port + "/method2",
new Method2());
System.out.println("Sleep 3 secs...");
Thread.sleep(3000);
} finally {
stop(endPoint2);
stop(endPoint1);
}
}
示例2: createSupplier
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public Datex2Supplier createSupplier(String supplierPath,
String subscriptionPath) {
if (subscriptionPath != null) {
ClientSubscriptionImpl subscription = new ClientSubscriptionImpl(
supplierPath, subscriptionPath);
autowire(subscription);
Endpoint.publish(subscriptionPath, subscription);
}
Datex2SupplierImpl supplier = new Datex2SupplierImpl(supplierPath,
subscriptionPath);
autowire(supplier);
ClientPullImpl pull = new ClientPullImpl(supplier);
autowire(pull);
Endpoint.publish(supplierPath, pull);
return supplier;
}
示例3: echo
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public String echo(String input, String serverHost, int port)
{
Endpoint ep = Endpoint.create(new EndpointBean());
String publishUrl = "http://" + serverHost + ":" + port + "/foo/bar";
ep.publish(publishUrl);
try
{
QName qname = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointService");
Service service = Service.create(new URL(publishUrl + "?wsdl"), qname);
EndpointInterface proxy = (EndpointInterface) service.getPort(EndpointInterface.class);
return proxy.echo(input);
}
catch (Exception e)
{
throw new WebServiceException(e);
}
finally
{
if (ep != null)
{
ep.stop();
}
}
}
示例4: testEndpointImplPublishCorrectlySetsTCCL
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
/**
* This verifies that DelegateEndpointImpl delegates to the Apache
* CXF EndpointImpl after having properly setup the TCCL so that it
* can load and create instances of the ProviderImpl class.
*/
@Test
public void testEndpointImplPublishCorrectlySetsTCCL()
{
ClassLoader orig = Thread.currentThread().getContextClassLoader();
try
{
Endpoint ep1 = new DelegateEndpointImpl(new TestEndpoint());
ep1.publish(new Integer(1)); //just to ensure the publish(Object arg) is used
ep1.publish("foo");
Thread.currentThread().setContextClassLoader(new TestClassLoader());
Endpoint ep2 = new DelegateEndpointImpl(new TestEndpoint());
ep2.publish(new Integer(1)); //just to ensure the publish(Object arg) is used
ep2.publish("foo");
}
finally
{
Thread.currentThread().setContextClassLoader(orig);
}
}
示例5: main
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public static void main(String[] argv) throws IOException {
try {
ConnectionsReader connReader = new ConnectionsReader();
QueriesReader queriesReader = new QueriesReader();
SettingsReader settingsReader = new SettingsReader();
HashMap<String, Object> config;
logs = new LogHandler();
config = settingsReader.readSettings(new File("").getAbsolutePath() +
File.separator + "config" + File.separator + "settings.xml", logs);
connections = connReader.readSettings(new File("").getAbsolutePath() +
File.separator + "config" + File.separator + "connections.xml", logs);
connections = queriesReader.readQueries(new File("").getAbsolutePath() +
File.separator + "config" + File.separator + "queries.xml", connections, logs);
Dispatcher implementor = new Dispatcher();
String address = "http://" + config.get("ip") + ":" + config.get("port") + "/" + config.get("name");
System.out.println("Server wsdl can be found on http://localhost:" + config.get("port") + "/" + config.get("name"));
Endpoint.publish(address, implementor);
} catch (Exception e) {
e.printStackTrace();
logs.write(Level.SEVERE, e.getMessage());
}
}
示例6: loadBus
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Override
public void loadBus(ServletConfig servletConfig)
{
super.loadBus(servletConfig);
// You could add the endpoint publish codes here
try {
//be sure to use the bus that's been created in loadBus..
Bus bus = getBus();
BusFactory.setThreadDefaultBus(bus);
Endpoint.publish("/Echo1", new EchoImpl());
} finally {
//free the thread default bus association in the current thread which
//is serving the servlet init, as it can have side effect on other
//servlet(s) deployed afterwards
BusFactory.setThreadDefaultBus(null);
}
}
示例7: main
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public static void main (String args[]) {
System.out.println("1. Bring up the hello world endpoint at port 18080");
Endpoint helloWorldEndPoint = Endpoint.create(new HelloWorldImpl());
helloWorldEndPoint.publish("http://localhost:18080/services/helloworld");
System.out.println("2. Programmatically publish the endpoint to UDDI");
Publish sp = new Publish();
try {
uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
UDDIClerk clerk = uddiClient.getClerk("joe");
System.out.println("setting up the publisher");
sp.setupJoePublisher(clerk);
System.out.println("publish the business");
sp.publishBusiness(clerk);
System.out.println("and the wsdl");
sp.publishWSDL(clerk);
System.out.println("waiting for calls into the HelloWorldImpl...");
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: createAndPublishEndpoint
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Override
public Endpoint createAndPublishEndpoint(String address,
Object implementor) {
Endpoint endpoint = new EndpointImpl(
BindingID.parse(implementor.getClass()),
implementor);
endpoint.publish(address);
return endpoint;
}
示例9: loadBus
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Override
protected void loadBus(ServletConfig sc) {
super.loadBus(sc);
Endpoint.publish("/TestService", new TestService());
Endpoint.publish("/ProfileService", new ProfileServiceImpl());
}
示例10: givenFakeSOAPWebservice
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Given("start SOAP webservice port '$port'")
public void givenFakeSOAPWebservice(String port) {
String serviceUrl = "http://localhost:" + port + "/WheatherServicePort";
Endpoint endpoint = Endpoint.publish(serviceUrl, new WheatherServiceImpl());
assertTrue(endpoint.isPublished());
Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());
}
示例11: givenFakeSOAPWebserviceThroughHttps
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Given("send SOAP web service through https")
public void givenFakeSOAPWebserviceThroughHttps() {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("src/test/resources/META-INF/spring/jaxws-server-with-ssl.xml");
BusFactory.setDefaultBus(bus);
Endpoint endpoint = Endpoint.publish("https://localhost:9091/WheatherServicePort", new WheatherServiceImpl());
assertTrue(endpoint.isPublished());
Assert.assertEquals("http://schemas.xmlsoap.org/wsdl/soap/http", endpoint.getBinding().getBindingID());
}
示例12: start
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public void start() throws Exception {
System.out.println("Starting Server");
Object implementor = new GreeterImpl();
String address = "jms:jndi:dynamicQueues/test.soap.jmstransport.queue?jndiInitialContextFactory="
+ "org.apache.activemq.jndi.ActiveMQInitialContextFactory&jndiConnectionFactoryName="
+ "ConnectionFactory&jndiURL=vm://localhost";
endpoint = Endpoint.publish(address, implementor);
}
示例13: startServer
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@BeforeClass
public static void startServer() throws Exception {
// Start the Greeter Server
Object implementor = new GreeterImpl();
String address = "http://localhost:" + port + "/SoapContext/SoapPort";
endpoint = Endpoint.publish(address, implementor);
LOG.info("The WS endpoint is published! ");
}
示例14: startService
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Before
public void startService() {
Object implementor = new GreeterImpl();
String address = "http://localhost:" + port + "/"
+ getClass().getSimpleName() + "/SoapContext/GreeterPort";
endpoint = Endpoint.publish(address, implementor);
}
示例15: setUp
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
endpoint = Endpoint.publish("http://localhost:" + port2 + "/"
+ getClass().getSimpleName() + "/jaxws-mtom/hello", getImpl());
SOAPBinding binding = (SOAPBinding)endpoint.getBinding();
binding.setMTOMEnabled(true);
}