本文整理汇总了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);
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
}
示例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: 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();
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
}
}