10.07.2015 Views

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

Lotus Instant Messaging/ Web Conferencing ... - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

import org.apache.soap.transport.http.SOAPHTTPConnection;public class JavaAgent extends AgentBase {public void NotesMain() {try {Session session = getSession();AgentContext agentContext = session.getAgentContext();Database db = agentContext.getCurrentDatabase();Agent ag1 = agentContext.getCurrentAgent();String paramid = ag1.getParameterDocID();Document doc = db.getDocumentByID(paramid);String userName = doc.getItemValueString("username");String announcementText = doc.getItemValueString("announcement");// (Your code goes here)short shAnnouncementStatus = sendAnnouncement(userName,announcementText);System.out.println("Status of announcement for user " + userName + ":" + shAnnouncementStatus);}catch(Exception e){e.printStackTrace();}}public short sendAnnouncement (String User, String Announcement) throwsException{Call call = new Call ();// If you are behind a proxy, you will need to uncomment these fourlines....//SOAPHTTPConnection shc = new SOAPHTTPConnection ();//shc.setProxyHost();//shc.setProxyPort();//call.setSOAPTransport (shc);URL url=newURL("http://t20-issluser:9080/AnnouncementSender/servlet/rpcrouter");// This service uses standard SOAP encodingString encodingStyleURI = Constants.NS_URI_SOAP_ENC;call.setEncodingStyleURI(encodingStyleURI);Chapter 6. Sametime and workflow 151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!