package com.domino.openntf;
import java.net.URL;
import java.util.HashMap;
import java.util.Vector;
import javax.faces.context.FacesContext;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceRef;
import lotus.domino.Database;
import lotus.domino.Document;
import lotus.domino.Session;
public class WSFake {
@WebServiceRef(wsdlLocation="http://www.bestcoder.net:80/samples/FakeWS?wsdl")
public static String Exec() {
String designElementName = "com.domino.openntf.WSFake";
String procedureName = "Exec";
try
{
FacesContext context = FacesContext.getCurrentInstance();
Session session = (Session) context.getApplication().getVariableResolver().resolveVariable(context, "session");
HashMap viewScope = (HashMap) context.getApplication().getVariableResolver().resolveVariable(context, "viewScope");
Database currentDatabase = com.ibm.xsp.model.domino.DominoUtils.getCurrentDatabase(context);
// Enter WebService URL with ending "?WSDL"
URL url = new URL("http://www.bestcoder.net:80/samples/FakeWS?wsdl");
QName qName = new QName("urn:DefaultNamespace", "WSFakeDomino");
InputVariables inp = new InputVariables();
inp.setNo(12345);
inp.setType("F");
WSFakeDomino wsPort = new WSFakeDomino(url, qName);
WSFake wsService = wsPort.getService();
// Invoke Web Service
OutputVariables out = wsService.getExec(inp)
if (out.getReturnCode() == 0) {
// No Error
// Do Something ...
} else {
// Error
// Do Something ...
}
} catch (Exception e) {
// Exception - Hata :" + e.getClass().toString() + " - " + e.getMessage()
}
return "OK";
}
}