Java 类javax.xml.ws.Endpoint 实例源码

项目:spring4-understanding    文件:AbstractJaxWsServiceExporter.java   
/**
 * 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);
    }
}
项目:neoscada    文件:EndpointExporter.java   
@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 ();
    }
}
项目:neoscada    文件:EndpointExporter.java   
@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 );
            }
        }
    }
}
项目:lams    文件:AbstractJaxWsServiceExporter.java   
/**
 * 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);
    }
}
项目:jdk8u-jdk    文件:WSTest.java   
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);
        }
    }
项目:openjdk-jdk10    文件:WSTest.java   
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);
        }
    }
项目:book_ldrtc    文件:CxfServer.java   
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);  
    }
项目:openjdk9    文件:WSTest.java   
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);
        }
    }
项目:jdk8u_jdk    文件:WSTest.java   
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);
        }
    }
项目:datex2    文件:Datex2.java   
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;
}
项目:myjavacode    文件:LeaveWebserviceUtil.java   
/**
 * 发布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");
}
项目:activiti-in-action-codes    文件:LeaveWebserviceUtil.java   
/**
 * 发布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");
}
项目:jaxws-undertow-httpspi    文件:EndpointAPITest.java   
@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();
   }
}
项目:jaxws-undertow-httpspi    文件:EndpointAPITest.java   
@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();
   }
}
项目:jaxws-undertow-httpspi    文件:EndpointAPITest.java   
@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();
   }
}
项目:db-component    文件:Dispatcher.java   
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());
    }
}
项目:respiro    文件:CxfPlugin.java   
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);
    }
}
项目:jbossws-cxf    文件:CXFEndpointServlet.java   
@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);
   }
}
项目:jbossws-cxf    文件:EndpointTestCase.java   
@Test
@RunAsClient
public void test() throws Exception
{
   String publishURL1 = "http://" + getServerHost() + ":" + port + "/jaxws-endpoint1";
   Endpoint endpoint1 = publishEndpoint(new EndpointBean(), publishURL1);

   String publishURL2 = "http://" + getServerHost() + ":" + port + "/jaxws-endpoint2";
   Endpoint endpoint2 = publishEndpoint(new EndpointBean(), publishURL2);

   invokeEndpoint(publishURL1);
   invokeEndpoint(publishURL2);

   endpoint1.stop();
   endpoint2.stop();
}
项目:jbossws-cxf    文件:WSClientEndpointBean.java   
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();
      }
   }
}
项目:jbossws-cxf    文件:UsecasesTestCase.java   
@Test
@RunAsClient
public void testDifferentPortsSameContext() throws Exception
{
   String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/";
   Endpoint endpoint1 = publishEndpoint1(new Endpoint1Impl(), publishURL1);

   String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint";
   Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);

   invokeEndpoint1(publishURL1);
   invokeEndpoint1(publishURL2);

   endpoint1.stop();
   endpoint2.stop();
}
项目:jbossws-cxf    文件:UsecasesTestCase.java   
@Test
@RunAsClient
public void testDifferentPortsNoContext() throws Exception
{
   String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/";
   Endpoint endpoint1 = publishEndpoint1(new Endpoint1Impl(), publishURL1);

   String publishURL2 = "http://" + getServerHost() + ":" + port2;
   Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);

   invokeEndpoint1(publishURL1);
   if (isIntegrationCXF())
   {
      //sun.net.www.protocol.http.HttpURLConnection barfs on addresses like http://localhost:8872?wsdl
      invokeEndpoint1(publishURL2.replace(String.valueOf(port2), port2 + "/"));
   }
   else
   {
      invokeEndpoint1(publishURL2);
   }

   endpoint1.stop();
   endpoint2.stop();
}
项目:jbossws-cxf    文件:UsecasesTestCase.java   
@Test
@RunAsClient
public void testDifferentPortsAndLongPaths() throws Exception
{
   String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/long/path/";
   Endpoint endpoint1 = publishEndpoint3(new Endpoint1Impl(), publishURL1);

   String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/long/path";
   Endpoint endpoint2 = publishEndpoint1(new Endpoint1Impl(), publishURL2);

   invokeEndpoint1(publishURL1);
   invokeEndpoint1(publishURL2);

   endpoint1.stop();
   endpoint2.stop();
}
项目:jbossws-cxf    文件:UsecasesTestCase.java   
@Test
@RunAsClient
public void testSamePortsAndAlmostIdenticalLongPaths() throws Exception
{
   String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1/";
   Endpoint endpoint1 = publishEndpoint2(new Endpoint1Impl(), publishURL1);

   String publishURL2 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number11";
   Endpoint endpoint2 = publishEndpoint3(new Endpoint1Impl(), publishURL2);

   invokeEndpoint2(publishURL1);
   invokeEndpoint2(publishURL2);

   endpoint1.stop();
   endpoint2.stop();
}
项目:jbossws-cxf    文件:UsecasesTestCase.java   
@Test
@RunAsClient
public void testDifferentPortsAndIdenticalPaths() throws Exception
{
   String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1/";
   Endpoint endpoint1 = publishEndpoint1(new Endpoint1Impl(), publishURL1);

   String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/number1";
   Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);

   invokeEndpoint2(publishURL1);
   invokeEndpoint2(publishURL2);

   endpoint1.stop();
   endpoint2.stop();
}
项目:jbossws-cxf    文件:ProviderImpl.java   
@Override
public Endpoint createEndpoint(String bindingId, Object implementor) {
   ClassLoader origClassLoader = getContextClassLoader();
   boolean restoreTCCL = false;
   try
   {
      restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
      setValidThreadDefaultBus();
      return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementor));
   }
   finally
   {
      if (restoreTCCL)
         setContextClassLoader(origClassLoader);
   }
}
项目:jbossws-cxf    文件:ProviderImpl.java   
@Override
public Endpoint createEndpoint(String bindingId,
      Object implementor,
      WebServiceFeature ... features) {
   ClassLoader origClassLoader = getContextClassLoader();
   boolean restoreTCCL = false;
   try
   {
      restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
      setValidThreadDefaultBus();
      return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementor, features));
   }
   finally
   {
      if (restoreTCCL)
         setContextClassLoader(origClassLoader);
   }
}
项目:jbossws-cxf    文件:ProviderImpl.java   
@Override
public Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
      Invoker invoker, WebServiceFeature ... features) {
   ClassLoader origClassLoader = getContextClassLoader();
   boolean restoreTCCL = false;
   try
   {
      restoreTCCL = checkAndFixContextClassLoader(origClassLoader);
      setValidThreadDefaultBus();
      return new DelegateEndpointImpl(super.createEndpoint(bindingId, implementorClass, invoker, features));
   }
   finally
   {
      if (restoreTCCL)
         setContextClassLoader(origClassLoader);
   }
}
项目:jbossws-cxf    文件:ProviderImplTest.java   
/**
 * 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);
   }
}
项目:SecureBPMN    文件:WebServiceProviderServlet.java   
@Override
public void loadBus(ServletConfig servletConfig) throws ServletException {
    super.loadBus(servletConfig);

    // TODO: Hacky first version to get default Process Engine
    ProcessEngine processEngine = ProcessEngineConfiguration
      .createProcessEngineConfigurationFromResourceDefault()
      .buildProcessEngine();

    Bus bus = getBus();
    BusFactory.setDefaultBus(bus); 
    Endpoint.publish("/RuntimeService", new RuntimeWebServiceImpl(processEngine));

    // You can als use the simple frontend API to do this
    ServerFactoryBean factory = new ServerFactoryBean();
    factory.setBus(bus);
    factory.setServiceClass(RuntimeWebServiceImpl.class);
    factory.setAddress("/RuntimeService");
    factory.create();              
}
项目:taskerbox    文件:SOAPChannel.java   
@Override
@WebMethod(exclude = true)
protected void execute() throws Exception {

  TaskerboxWebService<T> wsImpl = this.wsClass.newInstance();
  wsImpl.setChannel(this);

  Endpoint.publish(this.wsAddress, wsImpl);

  logInfo(log, "Web service '" + this.wsClass.getName() + "' was published successfully.\n"
      + "WSDL URL: " + this.wsAddress + "?WSDL");

  // Keep the local web server running until the process is killed
  while (Thread.currentThread().isAlive()) {
    try {
      Thread.sleep(10000);
    } catch (InterruptedException ex) {
    }
  }

}
项目:ds4p    文件:DocumentSegmentationClientTest.java   
@Before
public void setUp() {
    try {
        address = "http://localhost:9000/services/DocumentSegmentationService";
        ep = Endpoint.publish(address,
                new DocumentSegmentationServicePortTypeImpl());

        returnedValueOfProcessDocument = new SegmentDocumentResponse();
        returnedValueOfProcessDocument
                .setMaskedDocument("<ClinicalDocument></ClinicalDocument>");
        returnedValueOfProcessDocument.setProcessedDocument(null);
        returnedValueOfProcessDocument.setPostProcessingMetadata(null);

    } catch (Exception e) {
        logger.error(e.getMessage(), e);
    }
}
项目:ds4p    文件:ContextHandlerWebServiceClientTest.java   
@BeforeClass
public static void setUp() {
    try {
        address = "http://localhost:9000/services/DS4PContextHandler";
        ep = Endpoint.publish(address, new DS4PContextHandlerImpl());

        returnedValueOfEnforcePolicy = new Return ();
        returnedValueOfEnforcePolicy.setPdpDecision("Permit");
        returnedValueOfEnforcePolicy.setPurposeOfUse("TREAT");
        returnedValueOfEnforcePolicy.setHomeCommunityId("2.16.840.1.113883.3.467");
        returnedValueOfEnforcePolicy.setResourceId("");
        returnedValueOfEnforcePolicy.setResourceName("");
        returnedValueOfEnforcePolicy.setPdpStatus("");
        returnedValueOfEnforcePolicy.setPdpRequest("");
        returnedValueOfEnforcePolicy.setPdpResponse("");
        returnedValueOfEnforcePolicy.setRequestTime(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(2008,10,1)));
        returnedValueOfEnforcePolicy.setResponseTime(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar(2008,10,1)));

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
项目:datex2    文件:Datex2.java   
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;
}
项目:mhus-osgi-tools    文件:WebServiceInfoImpl.java   
public void connect() {
    if (isConnected() || getName() == null || getName().length() == 0 || service == null) return;
    error = null;
    endpoint = null;
    webService = service.getServiceObject();
    try {
        log.fine("JWS Connect: " + getName());
        endpoint = Endpoint.publish("/" + getName(), webService);
    } catch (Throwable t) {
        error = t.getMessage();
        webService = null;
        endpoint = null;
        log.log(Level.WARNING, "ERROR: " + getName() + " " + webService, t);
    }
    if (endpoint != null)
        service.published(this);
}
项目:juddi    文件:UDDI_170_ValueSetValidationIntegrationTest.java   
private void reset() throws Exception {
        messagesReceived = 0;
        if (ep == null || !ep.isPublished()) {
                int httpPort = 9600 + new Random().nextInt(99);
                String hostname = TckPublisher.getProperties().getProperty("bindaddress");
                if (hostname == null) {
                        hostname = InetAddress.getLocalHost().getHostName();
                }
                url = "http://" + hostname + ":" + httpPort + "/" + UUID.randomUUID().toString();
                logger.info("Firing up embedded endpoint at " + url);
                do {
                        try {

                                ep = Endpoint.publish(url, this);
                                httpPort = 9600 + new Random().nextInt(99);
                        } catch (Exception ex) {
                                logger.warn(ex.getMessage());
                        }
                } while (ep != null && !ep.isPublished());

        }

}
项目:juddi    文件:UDDI_090_HttpExternalTest.java   
@BeforeClass
public static void startup() throws Exception {
        if (!TckPublisher.isEnabled()) return;
        startManager();
        hostname = TckPublisher.getProperties().getProperty("bindaddress");
        if (hostname == null) {
                hostname = InetAddress.getLocalHost().getHostName();
        }
        port = 9600;
        //bring up the TCK SubscriptionListener
        String httpEndpoint = "http://" + hostname + ":" + port + "/tcksubscriptionlistener";
        System.out.println("Bringing up SubscriptionListener endpoint at " + httpEndpoint);
        endPoint = Endpoint.publish(httpEndpoint, new UDDISubscriptionListenerImpl());
        int count = 0;
        while (!endPoint.isPublished()) {
                port = 9600 + new Random().nextInt(99);
                httpEndpoint = "http://" + hostname + ":" + port + "/tcksubscriptionlistener";
                System.out.println("Bringing up SubscriptionListener endpoint at " + httpEndpoint);
                endPoint = Endpoint.publish(httpEndpoint, new UDDISubscriptionListenerImpl());
                count++;
                if (count > 10) {
                        Assert.fail("unable to bring up endpoint");
                }
        }

}
项目:juddi    文件:UDDI_090_HttpMavenIntegrationTest.java   
@BeforeClass
public static void startup() throws Exception {

        if (!TckPublisher.isEnabled()) {
                return;
        }
        startManager();
        hostname = "localhost";
        //bring up the TCK SubscriptionListener
        port = 9600;
        String httpEndpoint = "http://" + hostname + ":" + port + "/tcksubscriptionlistener";
        System.out.println("Bringing up SubscriptionListener endpoint at " + httpEndpoint);
        endPoint = Endpoint.publish(httpEndpoint, new UDDISubscriptionListenerImpl());
        int count = 0;
        while (!endPoint.isPublished()) {
                port = 9600 + new Random().nextInt(99);
                httpEndpoint = "http://" + hostname + ":" + port + "/tcksubscriptionlistener";
                System.out.println("Bringing up SubscriptionListener endpoint at " + httpEndpoint);
                endPoint = Endpoint.publish(httpEndpoint, new UDDISubscriptionListenerImpl());
                count++;
                if (count > 10) {
                        Assert.fail("unable to bring up endpoint");
                }
        }
}
项目:juddi    文件:Publish.java   
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();
    }
}
项目:wso2-axis2    文件:BasicEndpointTests.java   
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();
}