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 />

// Use the service to get a Stub to the Account<strong>Service</strong><br />

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

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

// Log into the web service to get a session ID.<br />

// loginID : The LoginID of the user(for example, spadmin).<br />

// password : The User Password (for example, spadmin).<br />

// bu : The business unit to which the user wants to log in (for example, <strong>CA</strong>)<br />

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

// The session ID can be used with any of the web services.<br />

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

String sessionID = fib.logIn(“spadmin”,”spadmin”,”<strong>CA</strong>”);<br />

// Using the sessionID the stub calls the method getAccountsOfBusinessUnit<br />

// businessunitid: the ID for the business unit for which the accounts are to be<br />

retrieved (for example, “Sales”)<br />

//Account[] retAccounts =<br />

//fib.getAccountsOfBusinessUnit(sessionID,);<br />

Account[] retAccounts =<br />

fib.getAccountsOfBusinessUnit(sessionID,”Sales”);<br />

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

{<br />

System.out.println("value of AccountID = " + retAccounts[i].getAccountID());<br />

System.out.println("value of AccountLabel = " +<br />

retAccounts[i].getAccountLabel());<br />

}<br />

// Log out. This terminates the session<br />

fib.logOut(sessionID);<br />

}catch(Exception e)<br />

{<br />

System.out.println("Throwing exception" + e.getMessage());<br />

}<br />

}<br />

)<br />

Kapitel 7: Verwenden von Webservices 133

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

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!