Commit 62086208 authored by ptajane's avatar ptajane

//Changed By Pankaj T. on 25-07-19 for API authentication pass site_code...

//Changed By Pankaj T. on 25-07-19 for API authentication pass site_code through API, if site_code passed from API is null then use login user site_code

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@204038 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4ddee86a
...@@ -38,7 +38,7 @@ public class SCMWebService ...@@ -38,7 +38,7 @@ public class SCMWebService
@POST @POST
@Path("/addTransaction") @Path("/addTransaction")
@Produces({"application/xml"}) @Produces({"application/xml"})
public Response addTransaction(@Context HttpServletRequest request, @FormParam("DATA_XML") String dataXML, @FormParam("USERNAME") String userCode, @FormParam("PASSWORD") String password) public Response addTransaction(@Context HttpServletRequest request, @FormParam("DATA_XML") String dataXML, @FormParam("USERNAME") String userCode, @FormParam("PASSWORD") String password, @FormParam("SITECODE") String siteCode)
{ {
String retString = ""; String retString = "";
ArrayList<String> langAndCountryList = new ArrayList<String>(); ArrayList<String> langAndCountryList = new ArrayList<String>();
...@@ -53,7 +53,15 @@ public class SCMWebService ...@@ -53,7 +53,15 @@ public class SCMWebService
return Response.status(HttpServletResponse.SC_BAD_REQUEST).entity(retString).build(); return Response.status(HttpServletResponse.SC_BAD_REQUEST).entity(retString).build();
} }
commonDBAccessLocal = new CommonDBAccessEJB(); commonDBAccessLocal = new CommonDBAccessEJB();
String siteCode = commonDBAccessLocal.getDBColumnValue( "USERS", "SITE_CODE__DEF","WHERE CODE = "+"'" +userCode+"'" ); System.out.println("SCMWebService.addTransaction() userCode : [" +userCode+ "]");
System.out.println("SCMWebService.addTransaction() siteCode : [" +siteCode+ "]");
//Changed By Pankaj T. on 25-07-19 for authentication pass site_code through API, if site_code passed from api is null then use login user site_code - start
if( "".equals(E12GenericUtility.checkNull(siteCode)) )
{
siteCode = commonDBAccessLocal.getDBColumnValue( "USERS", "SITE_CODE__DEF","WHERE CODE = "+"'" +userCode+"'" );
System.out.println("SCMWebService.addTransaction() siteCode against user: [" +siteCode+ "]");
}
//Changed By Pankaj T. on 25-07-19 for authentication pass site_code through API, if site_code passed from api is null then use login user site_code - end
String xmlInfoStr = commonDBAccessLocal.authenticate(userCode, password, siteCode, "I", "true"); String xmlInfoStr = commonDBAccessLocal.authenticate(userCode, password, siteCode, "I", "true");
System.out.println("authRetString["+xmlInfoStr+"]"); System.out.println("authRetString["+xmlInfoStr+"]");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment