當前位置: 首頁>>代碼示例>>Java>>正文


Java Endpoint.create方法代碼示例

本文整理匯總了Java中javax.xml.ws.Endpoint.create方法的典型用法代碼示例。如果您正苦於以下問題:Java Endpoint.create方法的具體用法?Java Endpoint.create怎麽用?Java Endpoint.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.xml.ws.Endpoint的用法示例。


在下文中一共展示了Endpoint.create方法的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);
	}
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:24,代碼來源:AbstractJaxWsServiceExporter.java

示例2: 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);
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:23,代碼來源:AbstractJaxWsServiceExporter.java

示例3: 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();
   }
}
 
開發者ID:jbossws,項目名稱:jaxws-undertow-httpspi,代碼行數:20,代碼來源:EndpointAPITest.java

示例4: 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();
   }
}
 
開發者ID:jbossws,項目名稱:jaxws-undertow-httpspi,代碼行數:27,代碼來源:EndpointAPITest.java

示例5: 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();
   }
}
 
開發者ID:jbossws,項目名稱:jaxws-undertow-httpspi,代碼行數:27,代碼來源:EndpointAPITest.java

示例6: 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();
      }
   }
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:26,代碼來源:WSClientEndpointBean.java

示例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();
	}
}
 
開發者ID:apache,項目名稱:juddi,代碼行數:26,代碼來源:Publish.java

示例8: testMetadata

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
public void testMetadata() throws Exception {
    SampleEndpoint sample = new SampleEndpoint();
    
    Endpoint ep = Endpoint.create(sample);
    assertTrue("The returned Endpoint instance was null", ep != null);
    
    ep.publish("test");
    assertTrue("The endpoint was not published successfully", ep.isPublished());
    
    String wsdlLocation = "http://test.wsdl.com/Test.wsdl"; // Dummy URL
    List<Source> metadata = new ArrayList<Source>();
    Source source = new StreamSource(new ByteArrayInputStream(new byte[0])); // Dummy content  
    source.setSystemId(wsdlLocation);  
    metadata.add(source);
    ep.setMetadata(metadata);
    
    metadata = ep.getMetadata();
    assertNotNull(metadata);
    source = metadata.get(0);
    assertNotNull(source);
    assertEquals(source.getSystemId(), wsdlLocation);
    
    ep.stop();
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:25,代碼來源:BasicEndpointTests.java

示例9: start

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
@Override
   public void start() throws Exception {
log.info("starting");
log.info("webservice port: " + this.getWebservicePort() + ", threadpool: " + this.getWebserviceThreads());
/* create webservice endpoint and publish */
this.webserviceEndpoint = Endpoint.create(new Webservice(this.getTransactionTimeout()));
ExecutorService executor = Executors.newFixedThreadPool(this.getWebserviceThreads());
this.webserviceEndpoint.setExecutor(executor);
this.webserviceEndpoint.publish("http://0.0.0.0:" + this.getWebservicePort() + "/ws/");
state = QBean.STARTED;
   }
 
開發者ID:bedefaced,項目名稱:jpos-example,代碼行數:12,代碼來源:Proxy.java

示例10: deployWebservice

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
private static String deployWebservice() throws IOException {
    // Manually create HttpServer here using ephemeral address for port
    // so as to not end up with attempt to bind to an in-use port
    httpServer = HttpServer.create(new InetSocketAddress(0), 0);
    httpServer.start();
    endpoint = Endpoint.create(new ServiceImpl());
    endpoint.publish(httpServer.createContext("/wservice"));

    String wsdlAddress = "http://localhost:" + httpServer.getAddress().getPort() + "/wservice?wsdl";
    log("address = " + wsdlAddress);
    return wsdlAddress;
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:13,代碼來源:Test.java

示例11: init

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
@Override
public void init(ServletConfig config) throws ServletException
{
   super.init(config);
   
   endpoint1 = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new EndpointBean());
   hostName = System.getProperty("jboss.bind.address", "localhost");
   hostName = (!hostName.startsWith("[") && hostName.indexOf(":") != -1) ? "[" + hostName + "]" : hostName;
   endpoint1.publish("http://" + hostName + ":8082/jaxws-endpoint");
   endpoint2 = Endpoint.publish("http://" + hostName + ":8082/jaxws-endpoint2/endpoint/long/path", new EndpointBean());
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:12,代碼來源:EndpointServlet.java

示例12: echo2

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
public String echo2(String input)
{
   Endpoint ep = Endpoint.create(new EndpointBean());
   if (ep.getBinding() == null || ep.getImplementor() == null)
   {
      throw new WebServiceException("null binding or implementor!");
   }
   return input;
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:10,代碼來源:WSClientEndpointBean.java

示例13: setUp

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
	this.testPort = new DigitalSignatureServiceTestPort();
	this.endpoint = Endpoint.create(this.testPort);
	String address = "http://localhost:" + getFreePort() + "/dss";
	this.endpoint.publish(address);

	this.client = new DigitalSignatureServiceClient(address);
}
 
開發者ID:e-Contract,項目名稱:dssp,代碼行數:10,代碼來源:DigitalSignatureServiceClientTest.java

示例14: 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.webServiceFeatures != null) {
		return new FeatureEndpointProvider().createEndpoint(this.bindingType, bean, this.webServiceFeatures);
	}
	else {
		return Endpoint.create(this.bindingType, bean);
	}
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:16,代碼來源:AbstractJaxWsServiceExporter.java

示例15: publishAndRegisterHttpCallbackEndpoint

import javax.xml.ws.Endpoint; //導入方法依賴的package包/類
public void publishAndRegisterHttpCallbackEndpoint() throws BindException {
	if (clerk!=null && listenerEndpoint==null) {
		try {
			listenerServiceUrl = new URL(urlLocalizer.rewrite(new URL(DEFAULT_SUBSCRIPTION_LISTENER_URL)));
			WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(clerk, urlLocalizer, properties);
			Definition wsdlDefinition = new ReadWSDL().readWSDL("org/apache/juddi/v3/client/mapping/UDDIClientSubscriptionListener.wsdl");
			
			String bindingKey = wsdl2UDDI.registerBusinessService(
					SUBSCRIPTION_LISTENER_SERVICE_NAME, 
					SUBSCRIPTION_LISTENER_PORT_NAME, listenerServiceUrl, wsdlDefinition).getBindingKey();
			UDDISubscriptionListenerPortType subscriptionListener = new UDDIClientSubscriptionListenerImpl(bindingKey, this);
			log.info("Bringing up a UDDIClientSubscriptionListenerImpl on Endpoint " + listenerServiceUrl.toExternalForm());
			listenerEndpoint = Endpoint.create(subscriptionListener);
			listenerEndpoint.publish(listenerServiceUrl.toExternalForm());
			
			log.info("Registering a CallbackSubscription to this endpoint using bindingKey " + bindingKey);
			registerSubscription(bindingKey);
			
		} catch (RuntimeException t) {
			listenerEndpoint = null;
			if (t.getCause() instanceof BindException) {
				throw new BindException(t.getCause().getMessage());
			} else {
				throw t;
			}
		} catch (Exception e) {
			log.error("Cannot publish or register the CallbackEndpoint " + e.getMessage(),e);
		}
	}
}
 
開發者ID:apache,項目名稱:juddi,代碼行數:31,代碼來源:UDDIServiceCache.java


注:本文中的javax.xml.ws.Endpoint.create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。