I am trying to do a HTTP post to Lawson from a non-lawson application. I have tried the servlet and LHC.jar. Each time I receve the HTML logon page and not the XML. I am doing a HTTP post to PA31. The servlet call works fine from portal.
Here is my code:
String strLawsonUsr = "ID"; String strLawsonPwd = "password"; String strLawsonUrl = "https://webqa.bcbsnc.com/sso/SSOServlet"; { LawsonHttpConnection lhc = new LawsonHttpConnection(); char [ ] charLawsonPwd = strLawsonPwd.toCharArray(); String result = lhc.doLogin(strLawsonUrl,strLawsonUsr,charLawsonPwd); ; say("@@@ API Login info: " + strLawsonUrl + " : " + strLawsonUsr + " : " + strLawsonPwd, 1); say("@@@ API Result : " + result, 1); ; if (result.equals(LHCConstants.SSO_STATUS_LOGIN_SUCCESS)) { say("@@@ API Login success ", 1); ResponseObject response = null; say("@@@ Getting ready to GET ", 1); response = lhc.doTransaction("https://webqa.bcbsnc.com/sso/SSOServlet","","GET"); ; say("@@@ Display GET response: " + response.getResponseBodyAsString(), 1); String postData = "https://webqa.bcbsnc.com/servlet/Router/Transaction/Erp?_PDL=QA%26_LFN=ALL%26_RTN=DATA%26_TDS=IGNORE%26_OUT=XML%26_EVT=ADD%26_TKN=PA31.1%26FC=A%DATE-APPLIED=20080825%26APL-PROCESS-LEVEL=34%26APL-EMP-STATUS=10%26APL-NBR-FTE=1.000%26APL-BIRTHDATE=19810828%26APL-BASE-CURRENCY=USD%26"; ; say("@@@ Getting ready to POST ", 1); response = lhc.doTransaction("https://webqa.bcbsnc.com/sso/SSOServlet",postData,"POST"); ; say("@@@ After Post ", 1); ; say("@@@ Display POST response: " + response.getResponseBodyAsString(), 1); } else { } }