ExternalService ,

ExternalService ,

reylorente1
Collaborator Collaborator
320 Views
1 Reply
Message 1 of 2

ExternalService ,

reylorente1
Collaborator
Collaborator

I'm exploring the ExternalService. I worked out this method to see if it worked for me, but it gives me the following error,

The server does not represent a server of a valid type to be used with the service.
Any idea why?
Or if there is an article about this Namespace to understand it.

I share with you about what I have done, it is simple:

 public class App : IExternalApplication
 {
     public Result OnStartup(UIControlledApplication a)
     {
         AddServers();
         return Result.Succeeded;
     }

     public Result OnShutdown(UIControlledApplication a)
     {
         return Result.Succeeded;
     }

     private void AddServers()
     {
         try
         {
             
             ExternalService externalService = ExternalServiceRegistry.GetService(ExternalServices.BuiltInExternalServices.ExternalUIService);
             SingleServerService service = externalService as SingleServerService;
             if (service == null)
             {
                 return;
             }

             TestExternalServices testServers = new TestExternalServices();

             if (testServers != null)
             {
                 service.AddServer(testServers);
             }
         }
         catch (Exception )
         {
             //TaskDialog.Show("Info", "Error" + ex.Message);
             throw;
         }
     }
 }
////
public class TestExternalServices : IExternalServer
{
    public string GetDescription()
    {
        return "Prueba para el servidor";
    }

    public string GetName()
    {
        return "Test";
    }

    public Guid GetServerId()
    {
        return new Guid("1384B8EE-9A47-434A-8564-7D828A60ACF8");
    }

    public ExternalServiceId GetServiceId()
    {
        return ExternalServices.BuiltInExternalServices.ExternalUIService;
    }

    public string GetVendorId()
    {
        return GetType().Name;
    }
}

 

Captura de pantalla 2024-09-01 001824.png

0 Likes
321 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni
0 Likes