20.11.2013 Aufrufe

CA Service Accounting und CA Service Catalog ...

CA Service Accounting und CA Service Catalog ...

CA Service Accounting und CA Service Catalog ...

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

Aufrufen von Webservices mit einem Java-Client<br />

Beispiel für das Aufrufen über einen HTTPS-Port<br />

In diesem Beispiel wird die Verwendung eines Java-Programms zum Aufrufen<br />

eines <strong>CA</strong> <strong>Service</strong> Management-Webservice über einen HTTPS-Port erläutert.<br />

Sie können dieses Beispiel als Modell verwenden.<br />

Wichtig! Wenn <strong>Service</strong>-Ansicht für die Ausführung auf dem HTTPS-Port<br />

konfiguriert ist, müssen Sie das Verzeichnis des generierten KeyStore <strong>und</strong> das<br />

zugehörige Kennwort im Aufruf verwenden, wie im folgenden Beispiel gezeigt.<br />

package testing.soap;<br />

public class axisTest {<br />

public static void main(String [] args) throws Exception {<br />

try<br />

{<br />

// constructing the endpoint for calling the Account Web<strong>Service</strong><br />

java.net.URL endpoint= new java.net.URL("https://:/usm/services/Account<strong>Service</strong>");<br />

System.setProperty("javax.net.ssl.trustStore", );<br />

// Eg: =<br />

//"C:\\j2sdk1.4.2_05\\jre\\lib\\security\\.keystore”<br />

System.setProperty("javax.net.ssl.trustPass",);<br />

// Eg: = “changeit”<br />

//calling the Locator which implements the Account Web<strong>Service</strong> interface.<br />

testing.soap.Account<strong>Service</strong>Impl<strong>Service</strong> service = new<br />

testing.soap.Account<strong>Service</strong>Impl<strong>Service</strong>Locator();<br />

// Now use the service to get a Stub to the Account Web<strong>Service</strong><br />

testing.soap.Account<strong>Service</strong>SoapBindingStub fib =<br />

(Account<strong>Service</strong>SoapBindingStub)service.getAccount<strong>Service</strong>(endpoint);<br />

// The initial call for logging into the webservice.<br />

// loginID : The LoginID of the user(Eg: spadmin).<br />

// password : The User Password.<br />

// domain : The businessunit which the user wants to logIn to (Eg:<br />

ca.com.)This is optional and if the value is null the default domain in taken.<br />

// sessionID: handle to the user used for calling the other methods.<br />

// This is used for single sign on to other webservices.<br />

String sessionID = fib.logIn(,,);<br />

// using the sessionID the stub calls the method getAccounts of<br />

BusinessUnit<br />

// businessunitid : the id of BU for which the user wants to extract the<br />

accounts //for.<br />

Account[] retAccounts = fib.getAccountsOfBusinessUnit(sessionID,);<br />

for(int i =0; i< retAccounts.length;i++)<br />

134 Administrationshandbuch

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!