本文整理汇总了Java中javax.xml.ws.Endpoint类的典型用法代码示例。如果您正苦于以下问题:Java Endpoint类的具体用法?Java Endpoint怎么用?Java Endpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Endpoint类属于javax.xml.ws包,在下文中一共展示了Endpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEndpoint
import javax.xml.ws.Endpoint; //导入依赖的package包/类
/**
* 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)
*/
@UsesJava7 // optional use of Endpoint#create with WebServiceFeature[]
protected Endpoint createEndpoint(Object bean) {
if (this.endpointFeatures != null || this.webServiceFeatures != null) {
WebServiceFeature[] endpointFeaturesToUse = this.endpointFeatures;
if (endpointFeaturesToUse == null) {
endpointFeaturesToUse = new WebServiceFeature[this.webServiceFeatures.length];
for (int i = 0; i < this.webServiceFeatures.length; i++) {
endpointFeaturesToUse[i] = convertWebServiceFeature(this.webServiceFeatures[i]);
}
}
return Endpoint.create(this.bindingType, bean, endpointFeaturesToUse);
}
else {
return Endpoint.create(this.bindingType, bean);
}
}
示例2: createSoapSignatureEndpoint
import javax.xml.ws.Endpoint; //导入依赖的package包/类
@Bean
public Endpoint createSoapSignatureEndpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, soapDocumentSignatureService());
endpoint.publish(SOAP_SIGNATURE_ONE_DOCUMENT);
enableMTOM(endpoint);
return endpoint;
}
示例3: dispose
import javax.xml.ws.Endpoint; //导入依赖的package包/类
@Override
public void dispose ()
{
super.dispose ();
List<Endpoint> endpoints;
synchronized ( this )
{
endpoints = new ArrayList<Endpoint> ( this.endpoints.values () );
this.endpoints.clear ();
}
for ( final Endpoint e : endpoints )
{
e.stop ();
}
}
示例4: unexportService
import javax.xml.ws.Endpoint; //导入依赖的package包/类
@Override
protected void unexportService ( final ServiceReference<?> serviceReference )
{
final Endpoint e;
synchronized ( this )
{
e = this.endpoints.remove ( serviceReference );
}
if ( e != null )
{
if ( e.isPublished () )
{
try
{
e.stop ();
}
catch ( final Exception ex )
{
logger.warn ( "Failed to stop export", ex );
}
}
}
}
示例5: createEndpoint
import javax.xml.ws.Endpoint; //导入依赖的package包/类
/**
* 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) {
if (this.endpointFeatures != null || this.webServiceFeatures != null) {
WebServiceFeature[] endpointFeaturesToUse = this.endpointFeatures;
if (endpointFeaturesToUse == null) {
endpointFeaturesToUse = new WebServiceFeature[this.webServiceFeatures.length];
for (int i = 0; i < this.webServiceFeatures.length; i++) {
endpointFeaturesToUse[i] = convertWebServiceFeature(this.webServiceFeatures[i]);
}
}
return Endpoint.create(this.bindingType, bean, endpointFeaturesToUse);
}
else {
return Endpoint.create(this.bindingType, bean);
}
}
示例6: 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);
}
}
示例7: main
import javax.xml.ws.Endpoint; //导入依赖的package包/类
public static void main(String[] args) {
// HelloWorldImpl implementor = new HelloWorldImpl();
// JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
// // 除了http://localhost部分其他部分可以随便写,但格式不能乱 http://IP:PORT/NAME
// factory.setAddress("http://localhost:8080/ws/hello");
// factory.setServiceClass(HelloWorld.class);//可省,但不建议,因为可能会有些小问题
// factory.setServiceBean(implementor);
//// //LoggingInInterceptor和LoggingOutInterceptor是日志拦截器,用于输入和输出时显示日志
// factory.getInInterceptors().add(new LoggingInInterceptor());
// factory.getOutInterceptors().add(new LoggingOutInterceptor());
// factory.create();
// System.out.println("ws is published");
HelloWorld hw = new HelloWorldImpl();
Endpoint.publish(ADDRESS, hw);
}
示例8: 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;
}
示例9: startServer
import javax.xml.ws.Endpoint; //导入依赖的package包/类
/**
* 发布Webservice
*/
public static void startServer() {
if (server != null) {
System.out.println("WebService服务正在运行。。。");
return;
}
LeaveWebService leaveWebService = new LeaveWebServiceImpl();
/*JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.setServiceClass(LeaveWebService.class);
svrFactory.setAddress(WEBSERVICE_URL);
svrFactory.setServiceBean(leaveWebService);
svrFactory.getInInterceptors().add(new LoggingInInterceptor());
svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
server = svrFactory.create();
server.start();*/
Endpoint.publish(WEBSERVICE_URL, leaveWebService);
System.out.println("请假Webservice已发布:" + WEBSERVICE_URL + "?wsdl");
}
示例10: testMultiplePublishSameAddress
import javax.xml.ws.Endpoint; //导入依赖的package包/类
@Test
public void testMultiplePublishSameAddress() throws Exception
{
server.start();
String contextPath = "/ctxt";
String path = "/echo";
for (int i = 0; i < 3; i++)
{
HttpContext ctx = UndertowContextFactory.createHttpContext(server, contextPath, path);
String address = "http://localhost:" + currentPort + contextPath + path;
Endpoint endpoint = Endpoint.create(new EndpointBean());
endpoint.publish(ctx); // Use httpserver context for publishing
invokeEndpoint(address);
endpoint.stop();
}
}
示例11: testMultipleEndpointsSameContext
import javax.xml.ws.Endpoint; //导入依赖的package包/类
@Test
public void testMultipleEndpointsSameContext() throws Exception
{
server.start();
String contextPath = "/ctxt";
String path = "/echo";
int k = 3;
Endpoint[] endpoints = new Endpoint[k];
HttpContext[] contexts = new HttpContext[k];
String[] addresses = new String[k];
for (int i = 0; i < k; i++)
{
addresses[i] = "http://localhost:" + currentPort + contextPath + path + i;
contexts[i] = UndertowContextFactory.createHttpContext(server, contextPath, path + i);
endpoints[i] = Endpoint.create(new EndpointBean());
endpoints[i].publish(contexts[i]);
}
for (int i = 0; i < k; i++)
{
invokeEndpoint(addresses[i]);
}
for (int i = 0; i < k; i++)
{
endpoints[i].stop();
}
}
示例12: testMultipleEndpointsDifferentContexts
import javax.xml.ws.Endpoint; //导入依赖的package包/类
@Test
public void testMultipleEndpointsDifferentContexts() throws Exception
{
server.start();
String contextPath = "/ctxt";
String path = "/echo";
int k = 3;
Endpoint[] endpoints = new Endpoint[k];
HttpContext[] contexts = new HttpContext[k];
String[] addresses = new String[k];
for (int i = 0; i < k; i++)
{
addresses[i] = "http://localhost:" + currentPort + contextPath + i + path;
contexts[i] = UndertowContextFactory.createHttpContext(server, contextPath + i, path);
endpoints[i] = Endpoint.create(new EndpointBean());
endpoints[i].publish(contexts[i]);
}
for (int i = 0; i < k; i++)
{
invokeEndpoint(addresses[i]);
}
for (int i = 0; i < k; i++)
{
endpoints[i].stop();
}
}
示例13: 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());
}
}
示例14: configureEndpoint
import javax.xml.ws.Endpoint; //导入依赖的package包/类
private void configureEndpoint(EndpointConfig config, Endpoint endpoint) {
Map<String, Object> props = endpoint.getProperties();
// Basic config
if(config.getWsdlService() != null) {
props.put(Endpoint.WSDL_SERVICE, config.getWsdlService());
}
if(config.getWsdlPort() != null) {
props.put(Endpoint.WSDL_PORT, config.getWsdlPort());
}
// setup schema validation
props.put(Message.SCHEMA_VALIDATION_ENABLED, SchemaValidation.SchemaValidationType.valueOf(schemaValidation.toUpperCase()));
for (EndpointCustomizer customizer : endpointCustomizers) {
customizer.configureEndpoint(endpoint);
}
}
示例15: 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);
}
}