I'm attempting to use the WF Java API to implement a SSO login for our product. I need to issue a WF_SIGNON request to Focus via the API and then redirect to the location specified by WF_SIGNON_MESSAGE. We set our WF_SIGNON_MESSAGE in site.wfs, but when I issue the request, it doesn't appear that site.wfs is being run. Instead, I get the value of WF_SIGNON_MESSAGE as set in cgivars.wfs.
The following is the relevant code:
ServletContext SC = request.getSession().getServletContext();
// webfocus_client_root comes from web.xml and is set to C:\ibi\WebFOCUS76\client\wfc
String CGILocation = SC.getInitParameter("webfocus_client_root") + File.separator + "web" + File.separator + "cgi";
WFApplicationRequest WFReq = new WFApplicationRequest();
WFResponse WFResp = new WFApplicationResponse(new ByteArrayOutputStream(4096));
WFServletVariableTableExtension wfSrvTabExt=
new WFServletVariableTableExtension(request, SC);
WFReq.addParameter("IBIC_user", IBIC_user);
WFReq.addParameter("IBIC_pass", IBIC_pass);
WFReq.addParameter("IBIC_server", "EDASERVE");
WFReq.addParameter("IBIWF_action", "WF_SIGNON");
WFReq.addParameter("IBIWF_format", "XML");
WFContext context = new WFContext(CGILocation, wfSrvTabExt, null, null, request, "SSOLogin", WFReq.getSession(true));
WFRequestWorker WFReqWorker = new WFRequestWorker(context, WFReq, true, -1);
WFResponseWorker WFRespWorker = new WFResponseWorker(context, WFResp, true);
WFPresentationInterface presentation = WFReqWorker.processRequest();
if(presentation != null){
WFRespWorker.processResponse(presentation, null);
}
String RedirectLoc = context.getValue("WF_SIGNON_MESSAGE");
// Prints out:
// RedirectLoc: /ibi_html/default.htm
// Should be: /ibi_apps/WFServlet?IBIF_ex=SomeFex
System.out.println("RedirectLoc: " + RedirectLoc);
/* Prints out:
* <ibwfrpc name="WF_SIGNON">
* <returncode>1000</returncode>
* </ibwfrpc>
*/
System.out.println(WFResp.getOutputStream());
context.closeContext();
// Add cookies from WF to response.
Cookie[] cookies = WFResp.getCookies();
for(int i = 0, len = cookies.length; i < len; i++){
response.addCookie(cookies[i]);
}
// Do the redirect.
response.sendRedirect(RedirectLoc);
Can anyone give me some hints as to why site.wfs is not getting executed and what I should do to change that?
Thanks!This message has been edited. Last edited by: Kerry,
WF 7.6.7/Win 2k3 Server
March 09, 2010, 01:19 PM
dlogan
Site.wfs should always be executed on an API call.
Are you using IF logic in your site.wfs to set the WF_SIGNON_MESSAGE syntax?
If so getting a WFServlet trace and searching for site.wfs will allow you to look at how the logic is being executed and see if its being processed as you expect.