Commit 76d3416b authored by pchavan's avatar pchavan

Add getBankDtl method in web services to retrieve bank data from site code.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@181699 ce508802-f39f-4f6c-b175-0d175dae99d5
parent c89bfb7f
package ibase.webitm.servlet.dis;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import javax.naming.InitialContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import org.json.JSONObject;
import org.json.XML;
import org.w3c.dom.Document;
import ibase.ejb.CommonDBAccessLocal;
import ibase.servlet.Messages;
import ibase.system.config.AppConnectParm;
import ibase.utility.BaseException;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.dis.SCMWebServiceDao;
import ibase.webitm.utility.ITMException;
......@@ -26,6 +31,10 @@ import ibase.webitm.utility.ITMException;
public class SCMWebService
{
SCMWebServiceDao scmWSDao = new SCMWebServiceDao();
//PriyankaC on [START..]
private UserInfoBean userInfo = null;
private E12GenericUtility genericUtility = new E12GenericUtility();
//PriyankaC [END].
@POST
@Path("/addTransaction")
......@@ -74,6 +83,7 @@ public class SCMWebService
return Response.status(HttpServletResponse.SC_OK).entity( retString ).build();
}
private String generateResponse( String xmlInfo, ArrayList<String> langAndCountryList )throws BaseException
{
StringBuffer responseString = new StringBuffer();
......@@ -161,4 +171,25 @@ public class SCMWebService
}
return ctx;
}
//Added By PriyankaC To getBank DATA on 27FEB2018...[START]
@GET
@Path("/getBankDetails")
@Produces({"application/xml", "application/json"})
public Response getBankDetails( @Context UriInfo siteCode , @QueryParam("USERCODE") String userCode,@QueryParam("PASSWORD") String password ,@QueryParam("MASTER_REQ") String masterReq ) throws BaseException, Exception
{
String retString = "";
List<String> sitecodeList = siteCode.getQueryParameters().get("SITECODE");
System.out.println("Received List: "+sitecodeList +"PASSWARD" +password +" MASTER_REQ " +masterReq);
if( (sitecodeList==null || sitecodeList.isEmpty() == true) || (userCode == null || userCode.trim().length() == 0) || (password == null || password.trim().length() ==0) || (masterReq == null || masterReq.trim().length()==0))
{
System.out.println("IN missing parameters");
retString = "<Root><msg_code><![CDATA[]]></msg_code><msg_descr><![CDATA[Missing required paramters]]></msg_descr></Root>";
JSONObject jsonObj = null;
jsonObj = XML.toJSONObject(retString);
return Response.status(HttpServletResponse.SC_BAD_REQUEST).entity(jsonObj.toString()).build();
}
retString = scmWSDao.getResult(sitecodeList,userCode,password,masterReq);
return Response.status(HttpServletResponse.SC_OK).entity( retString ).build();
}
//Added By PriyankaC To getBank DATA on 27FEB2018..[END]
}
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