Error: Not Authorized
Eg.
From my experience, I have seen this "Not Authorized" error showing-up in component interfaces, anywhere PeopleCode tries to invoke a component interface. Just include the component interface to the required permission list
Here's my findings and experience with PeopleSoft/PeopleTools which I gained working as an application engineer for PeopleSoft Campus Solutions.
Error: Not Authorized
Eg.
From my experience, I have seen this "Not Authorized" error showing-up in component interfaces, anywhere PeopleCode tries to invoke a component interface. Just include the component interface to the required permission list
-
-
Here's the way to create windows service out of your PeopleSoft single-user standalone instance's
app server, process scheduler, and PIA.It's as easy as specifying the required domain name(s) in PSADMIN/"Configure a Service" and instantiating a
windows service out this configuration using PSADMIN/"Install a Service"And for PIA, amazingly just invoke PS_HOME\webserv\<DOMAIN>\bin\installNTservicePIA.cmd, and you are good to go.
Once done, you can start the services from the Services utility in the Windows Control Panel or Run command "services.msc".
You can make the services to start automatically on machine reboot.
-
-
Details
Creating Windows NT Services out of PeopleSoft App Server and Process Scheduler
-
-
PSADMIN
Select “Service Setup”
-
Select “Configure a Service”
-
Select ‘Y’ for ‘Do you want to change any config values (y/n)?’
-
Enter the names of the application server domains and the Process Scheduler databases
that you want to include as part of the Microsoft Windows service.
To add multiple domains or databases, delimit each value with a comma and a space.
-
Select ‘Install a Service’ from the PeopleSoft Services Administration menu.
-
FYI….the psntsrv.exe file
-
Services utility in the Windows Control Panel or Run command "services.msc"
On the General tab of the service properties, select a startup type of Automatic.
On the Log On tab, the Log On As setting must match the Log On As setting that's defined for the
BEA ProcMGR V 9 service, which was created when you installed BEA Tuxedo.
Both services should either be configured to Log On As Local System Account, or to Log On As This Account (referring to the same account).
-
-
Troubleshooting
In case the service gives any error in starting you can view the details in Windows Logs.
How to View Event Logs
In Windows XP, an event is any significant occurrence in the system or in a program
that requires users to be notified, or an entry added to a log. The Event Log Service
records application, security, and system events in Event Viewer. With the event logs in
Event Viewer, you can obtain information about your hardware, software, and system
components, and monitor security events on a local or remote computer. Event logs can
help you identify and diagnose the source of current system problems, or help you
predict potential system problems.
To open Event Viewer, follow these steps:
1. Click Start, and then click Control Panel.
a. Click Performance and Maintenance,
b. then click Administrative Tools, and
c. then double-click Computer Management. Or,
d. open the MMC containing the Event Viewer snap-in.
2. In the console tree, click Event Viewer.
The Application, Security, and System logs are displayed in the Event Viewer window.-
-
-
Creating Windows NT Services out of PeopleSoft Internet Architecture (PIA)
-
-
Starting BEA WebLogic on Microsoft Windows
To run BEA WebLogic Server on Microsoft Windows, you can use a Windows service or a foreground process.
Using the Windows Service
Two benefits of running BEA WebLogic as a Windows service are:
1. BEA WebLogic can automatically start when the Windows server boots.
2. You can start and stop the service from a remote Windows machine.
To install the service, open the command prompt, and enter the appropriate command from your WebLogic <domain>\bin directory: <PS_HOME>/
Single server:
installNTservicePIA.cmd
Multi server:
InstallNTservice.cmd weblogic_server_instance_name
For example:
installNTservice.cmd PIA
To start BEA WebLogic as a Windows service, use either of these methods:
Start the service named WebLogicdomain-servername (for example, peoplesoft-PIA) by using the
Services utility in the Windows Control Panel.
Start the service from a command prompt by entering the following command:
NET START peoplesoft-PIA
To uninstall the service, enter the following command:
UninstallNTservicePIA.cmd
Generating XML with namespace prefixes using PeopleCode XMLDoc object.
-
It may sound stupid but we do this by adding the xmlns as an attribute to the required element. Off course against the XML specs, which clearly says that we should never treat xmlns as an attribute.
-
Required XML (sample):
<?xml version="1.0"?>
<q0:bibliograpphy xmlns:q0="http://example.org">
<q0:book>
<q0:title>TCP/IP Illustrated</q0:title>
<q0:publisher>Addison-Wesley</q0:publisher>
<price>65.95</price>
</q0:book>
</q0:bibliograpphy>-
-
PeopleCode
Local XmlDoc &reqXML = CreateXmlDoc("");
Local XmlNode &root = &reqXML.CreateDocumentElement("q0:bibliograpphy", "http://example.org");
&root.AddAttribute("xmlns:q0", "http://example.org");
Local XmlNode &book = &root.AddElement("q0:book");
Local XmlNode &temp = &book.AddElement("q0:title").AddText("TCP/IP Illustrated");
&temp = &book.AddElement("q0:publisher").AddText("Addison-Wesley");
&temp = &book.AddElement("price").AddText("65.95");Local File &file = GetFile("<SOME_PATHTest>/XMLDoc.xml", "W", %FilePath_Absolute);
&file.WriteLine(&reqXML.GenFormattedXmlString());-
-
-
-
FTP using PeopleCode PutAttachment() inside App Engine
-
The return code (%Attachment_FileNotFound) from PutAttachment() PeopleCode built-in function was incorrect.
Internally, it was failing as Write Access was revoked on the FTP server (ftp://username:password@hostname/AEI/SAKAI/)
This FTP server is running on some Windows Server 2008 machine and we need to contact the owner to get the write access.
Here's the ftp log generated from PutAttachment() PeopleCode.
verbose on
bin
200 Type set to I.
mkdir AEI
550 AEI: Cannot create a file when that file already exists.
cd AEI
250 CWD command successful.
mkdir SAKAI
550 SAKAI: Cannot create a file when that file already exists.
cd SAKAI
250 CWD command successful.
Local directory now C:\.
Local directory now C:\Documents and Settings.
Local directory now C:\Documents and Settings\BJETHWAN.PEOPLESOFT.
Local directory now C:\Documents and Settings\BJETHWAN.PEOPLESOFT\Local Settings.
Local directory now C:\Documents and Settings\BJETHWAN.PEOPLESOFT\Local Settings\Temp.
lcd C:\
lcd DOCUME~1
lcd BJETHW~1.PEO
lcd LOCALS~1
lcd Temp
put "bin.xml" "bin.xml"
200 PORT command successful.
550 bin.xml: Access is denied.
-
And here's the output from command line
-
C:\>bin.xml
C:\>ftp 10.138.125.144
Connected to 10.138.125.144.
220 Microsoft FTP Service
User (10.138.125.144:(none)): ftpuser1
331 Password required for ftpuser1.
Password:
230 User ftpuser1 logged in.
ftp> put bin.xml bin.xml
200 PORT command successful.
550 bin.xml: Access is denied.
ftp> cd AEI
250 CWD command successful.
ftp> cd SAKAI
250 CWD command successful.
ftp> delete READGROUPSFROMSAVEPOINT.xml
550 READGROUPSFROMSAVEPOINT.xml: Access is denied.
ftp> bye
C:\>
-
-
Basic FTP Commands
-
-
DMS to Export PeopleSoft Project Message Catalog Entries
-
Export PSMSGCATDEFN Where MESSAGE_SET_NBR=14950 And MESSAGE_NBR IN (55, 56, 57, 58, 59, 60, 61, 64, 65, 66, 67);
Export PSMSGCATDEFN Where MESSAGE_SET_NBR=14951 And MESSAGE_NBR IN 138, 139, 27, 28, 29, 30, 63, 64);
We moved to following DMS to export all the message catalog entries inserted in the project definition. And it doesn’t have to change every time you create and insert new entries in the project definition.
EXPORT PSMSGCATDEFN
WHERE EXISTS
(
SELECT 'X' FROM PSPROJECTITEM B
WHERE B.PROJECTNAME = '<< insert your project name >>'
AND OBJECTTYPE = 25
AND OBJECTVALUE1 = MESSAGE_SET_NBR
AND OBJECTVALUE2 = MESSAGE_NBR
);
-
-
DMS to remove past and future dated rows from a effective dated table
-
Following gave SQL Validator issues stating that table name alias can NOT be used in a delete / update SQL in a DMS script.
Following is the DMS scripts which leads to SQL Validator issue
-- Removing past and future dated rows from a effective dated table
DELETE FROM PS_TABLE_NAME TABLE_ALIAS1
WHERE EXISTS(
SELECT 'X' FROM PS_TABLE_NAME TABLE_ALIAS2
WHERE TABLE_ALIAS1 .FIELD1 = TABLE_ALIAS2.FIELD1
AND TABLE_ALIAS1 .FIELD2 = TABLE_ALIAS2.FIELD2
AND %EffdtCheck(TABLE_NAME, TABLE_ALIAS2, %CurrentDateTimeIn)
AND TABLE_ALIAS1.EFFDT <> TABLE_ALIAS2.EFFDT
);
And I used the following to resolve that issue, the crux is to hold the required data in a .dat file, delete the complete table and re-populate the table with the data in the .dat file. So both export and import happening in the same DMS import script we submit to bundle.
-- Removing past and future dated rows from a effective dated table
SET OUTPUT updXXXXXX_XX.dat;
EXPORT TABLE_NAME WHERE %EffdtCheck(TABLE_NAME, PS_TABLE_NAME, %CurrentDateIn);
DELETE FROM PS_SAE_CRSCTLG_EXT;
SET INPUT updXXXXXX_XX.dat;
IMPORT TABLE_NAME;
****************************************************************************************************************************************************************************
-
-
Gateway ID/Connector ID setup at Node vs Routing level
The ConnectorID is not required at the Node as long as there are no Routings defined (with that node as a Target Node) where these routings are not using Connector Override on the routing or within PeopleCode.
Note that a gateway only needs to even be defined for outbound routings only (in other words if one had all inbound routings a gateway does not even need to be defined on the gateway page).
As long as this Node will always be used on routings that have its own connector override at the routing level then no Node connector needs to be defined.
-
-
****************************************************************************************************************************************************************************
-
-
Issue: Synchronous Service Operations : Multiple Active Routings
-
While working on SAIP, we found an issue invoking a synchronous service operation having multiple active routings (i.e. multiple receiver nodes). At a time we wanted to invoke that service opetation for only one of the multiple active routings.
Initially we decided, to use a OnRoute Handler (as was suggested in PeopleBooks) to pick the correct routing (i.e. the receiver node), but we identified a small issue with that approach too and then moved to extending sendMessage() method in CS SOA framework. Wherein instead of using
&response_msg = %IntBroker.SyncRequest(&request_msg);
-
we planned to use either
-
&response_msg = %IntBroker.SyncRequest(&request_msg, Node.TargetNode1);
-
or
-
&responseMsgArray = %IntBroker.SyncRequest([&MsgArray, &NodeNames]) ;
but only after verifying if the given node was in the receiver node list of that service operation.
Example Service Operation
Service Operation: General Tab
Service Operation: Handler Tab
Service Operation: Routings Tab
OnRote handler (Impementing PS_PT:Integration:IRouter - OnRouteSend )PeopleCode
-
method OnRouteSend
/+ &_MSG as Message +/
/+ Returns Integer +/
/+ Extends/implements PS_PT:Integration:IRouter.OnRouteSend +/
/* Variable Declaration */
Local any &aNodeList;
Local any &rootNode;
Local Rowset &TargetRowset;
Local string &TargetNode;
/* The node name is in the header part of the message */
&destinationNodes = CreateArray();
&TargetRowset = &_MSG.GetPartRowset(1);
&TargetNode = &TargetRowset(1).GetRecord(Record.SAE_EVENT_INFO).SAE_TARGET_NODE.Value;
&destinationNodes.Push(&TargetNode);
Return (%IntBroker_ROUTE_SOME);
end-method;
-
Issue
-
Here we had a issue wherein if we populate the &destinationNodes string array with a node name which is not not specified as a receiver node in the list of service operation routings, PeopleCode throws an exception and shows that service operation as “ERROR” in “Synchronous Services - Monitor”
-
Resolution
-
Then we realized that we can handle it in another way rather then using OnRote handler (Impementing PS_PT:Integration:IRouter - OnRouteSend ) to pick the correct routing. We decided on using &response = %IntBroker.SyncRequest(&p_msg, &TargetNode); .
However, before even executing this SyncRequest, we planned to verifyif that node is in the receiver node list of that service operation all this using a IB provided component interface (IB_ROUTINGDEFN_CI) for IB routing component.
We overridden the sendMessage() method in CS SOA framework
method sendMessage
/+ &p_msg as Message +/
/+ Returns Message +/
/+ Extends/implements SCC_SERVICE:AbstractServiceOperation.sendMessage +/
Local Message &response;
Local Rowset &TargetRowset;
Local string &TargetNode, &TargetServiceOperation;
Local SAE_FRAMEWORK:UTIL:GeneralUtil &objGeneralUtil = create SAE_FRAMEWORK:UTIL:GeneralUtil();
%This.log.logInfo(MsgGetText(14099, 8, ""));
&TargetRowset = &p_msg.GetPartRowset(1);
&TargetNode = &TargetRowset(1).GetRecord(Record.SAE_EVENT_INFO).SAE_TARGET_NODE.Value;
&TargetServiceOperation = &TargetRowset(1).GetRecord(Record.SAE_EVENT_INFO).SAE_TRGT_OPERATION.Value;
If (&objGeneralUtil.existsActiveRouting(&TargetServiceOperation, &TargetNode)) Then
&response = %IntBroker.SyncRequest(&p_msg, @("Node." | &TargetNode));
End-If;
Return &response;
end-method
-;
Here’s the magic code to find if a given node exists in the receiver node list of the specified service operation
-.
method existsActiveRouting
/+ &pServiceOperationName as String, +/
/+ &pNodeName as String +/
/+ Returns Boolean +/
Local number &indexServiceOperationRoutings;
Local ApiObject &oSession, &oSaeIbRoutingdefnCi, &oSaeIbRoutingdefnCiRet, &oSaeIbRoutingdefnCiCollection;
-
&oSession = %Session;
&oSession.PSMessagesMode = 1;
-
&oSaeIbRoutingdefnCi = &oSession.GetCompIntfc(CompIntfc.IB_ROUTINGDEFN_CI);
-
If &oSaeIbRoutingdefnCi = Null Then
rem "Unable to retrieve CI for routings.";
End-If;
-
&oSaeIbRoutingdefnCi.InteractiveMode = False;
&oSaeIbRoutingdefnCi.GetHistoryItems = True;
&oSaeIbRoutingdefnCi.EditHistoryItems = True;
-
&oSaeIbRoutingdefnCi.IB_OPERATIONNAME = &pServiceOperationName;
&oSaeIbRoutingdefnCiCollection = &oSaeIbRoutingdefnCi.find();
-
For &indexServiceOperationRoutings = 1 To &oSaeIbRoutingdefnCiCollection.Count;
&oSaeIbRoutingdefnCiRet = &oSaeIbRoutingdefnCiCollection.Item(&indexServiceOperationRoutings);
&oSaeIbRoutingdefnCiRet.Get();
If (&oSaeIbRoutingdefnCiRet.IB_OPERATIONNAME = &pServiceOperationName And
&oSaeIbRoutingdefnCiRet.EFF_STATUS = "A" And
&oSaeIbRoutingdefnCiRet.RECEIVERNODENAME = &pNodeName) Then
Return True;
End-If;
End-For;
Return False;
end-method;
-
****************************************************************************************************************************************************************************
<PS_HOME>\webserv\<web-application>\applications\peoplesoft\PSIGW\errorLog.html
PeopleSoft Integration Broker and TCP Monitor (tcpmon v1.1)
No one can refute the benefit of using tcpmon when testing a web-service. I was trying WS-Security stuff on PeopleSoft Campus solutions when I wanted to see the actual WS-Security xml elements in SOAP Header.
And I decided to use the TCPMonitor as no PeopleSoft component was showing me the complete SOAP message.
Following is a proof of concept where in I have implemented a small mock application using PeopleSoft Integration Broker and two PSFT nodes.
Since I wanted to use two PeopleSoft node only but still use HTTPTARGET connector (hope you know that if 2 PeopleSoft nodes communicate over PSFTTARGET connector target then you would rather see the cryptic JOLT string in tcpmon) I had to use build the web-service and WSDL in service provider node and in local ie service requester I used WSDL_NODE provided by PeopleSoft node with Gateway ID=LOCAL and Connector ID= “” and provided the Target URL in Routing.
Node
Requester Service Operation
Requester Routing
Primary URL: http://localhost:8080/PSIGW/PeopleSoftServiceListeningConnector
TCPMonitor
Request XML
Response XML
In PeopleTools 8.49 we used the DMS scripts to import export the message schemas. While in PeopleTools 8.5 used the new Message Schema definition in App Designer to place the message schema into the app designer project definition itself.
PT8.49 import/export scripts <PT_HOME>\scripts psibmsgschema_imp.dms and psibmsgschema_exp.dms