Raritan Computer CC-WSAPI-0B-v5.1.0-E Instrukcja Użytkownika Strona 36

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 54
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 35
Appendix B: Web Services Development in Java
32
Call the method from your application for each service object. This
example uses AuthenticationAndAuthorizationService:
CCSGAuthenticationAndAuthorizationService service =
new CCSGAuthenticationAndAuthorizationService();
AuthenticationAndAuthorizationService service_port =
service.getAuthenticationAndAuthorizationServicePort(
);
set_service_end_point( service,
(BindingProvider)service_port );
This procedure must be done for each service, like
NodeManagementService, to connect to the intended CC-SG.
Calling a Web Service
JAX-WS requires an instance of the service class for the desired service
generated by wsimport. The service object contains a port object that
one can use to call the service methods as shown below:
CCSGAuthenticationAndAuthorizationService service = new
CCSGAuthenticationAndAuthorizationService();
AuthenticationAndAuthorizationService service_port =
service.getAuthenticationAndAuthorizationServicePort();
try
{
String sessionID = port.signOn( user, password );
} catch ( security.service.webservice.bl.cc.raritan.com
AuthenticationAndAuthorizationException ex )
{
System.out.println( "AuthenticationAndAuthorizationException: " +
ex.getFaultInfo().getMessage() );
System.out.println( "\t" + ex.getFaultInfo().getCode() );
System.out.println( "signOn() for user " + user + " failed." );
}
Sample Application for Java
Przeglądanie stron 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 53 54

Komentarze do niniejszej Instrukcji

Brak uwag