Discussion

How to extract the URL in an activity

I need to extract the URL in a Code-Security activity called from an Authentication Service, used during our single sign on. I've tried extracting it from the pxRequestor.pxHTTPServletRequest facade object, but the "Authentication in PegaRULES Process Commander" document for 5.3 doesn't tell us how to extract properties from the pxRequestor.pxHTTPServletRequest facade object, only what is not available. Anyone have any ideas?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

January 22, 2009 - 10:06am

I think you can use this sort of mechanism to extract different properties from header Info:
@java("((javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject(\"pxHTTPServletRequest\")).getHeader(\"pyuseridentifier\")")
Use this in PropertiesValue field in Property-Set method of an activity.

January 22, 2009 - 10:26am

Thanks for the post. I've already tried something like that, but this is referring to a property in a custom HTTP header in the facade object. In order to use something like this, I need to know the list of available properties in the facade object, particularly the one holding the URL. The PDN tells us what is not in the facade object, but not what is in it.

January 26, 2009 - 11:09am

The document I referenced in my original messages is the "Authentication in PegaRULES Process Commander v 5.3" document. It can be found by searching for that text.

January 26, 2009 - 11:23am

Dave-

Aha, here is the doc. Note that a number of our PDFs have been converted to HTML for easier searchability.

I'm guessing that the documentation doesn't tell you what properties *are* available in the facade HttpServletRequest object because these may include user-generated properties.

I scribbled this little activity last week to simply output a table of properties from the HttpServletRequest object. Let me know if this helps.

ClipboardPage pxRequestorPage = tools.findPage ("pxRequestor");

// get the HttpServletRequest object from the pxRequestor clipboard page
javax.servlet.http.HttpServletRequest req = (javax.servlet.http.HttpServletRequest) pxRequestorPage.getObject("pxHTTPServletRequest");

String content = "";

if (req != null)

// Get the names of all headers
java.util.Enumeration headerNames = req.getHeaderNames();

output.append("<table>");

// Loop through all of the headers.
while (headerNames.hasMoreElements())

String header = (String) headerNames.nextElement();
String value = req.getHeader(header);
output.append("<tr><td>" + header + "</td><td>" + value + "</td></tr>");

output.append("</table>");

content = output.toString();
else
content = "HttpServletRequest is null.";

String html = "<html><body>" + content + "</body></html>";

ClipboardPage Thread = tools.findPage ("pxThread");
Thread.putString("pyHTMLStream",html);
oLog.error(content);

Jon

September 12, 2014 - 8:33am

HI ALL ,

Need help !!

how i can get the end-point URL for HTTP -service , so that i can supply to extrnal system . unlike we get a wsdl link for SOAP service .

need steps

Thanks in Advance

 

 

March 9, 2015 - 11:05pm

How do i set something at the servelet level and get it from pxHTTPServletRequest facade object

 

I tired

Addheader

setheader

setattribute. Nothingw worked. pls help