We are using DotNet WCF. This is DEV Code. When we pointed Dev database to TEST, it shows full username. So, I think there is issue with the WCF or the the stored procedure's out parameter is not completely taken in by the WCF code. Also, I think there's no issue with the WEB app since, I pointed endpoint address of test in DEV web.config and it shows full username.
WcfServiceSVC.cs logic:
public string GetEmpName(int employeeID)
{
var credLogic = new Logic.Credentials.CredentialsLogic();
var empName = credLogic.GetEmpName(employeeID);
return empName;
}
Credentials Logic:
public string GetEmpName(int employeeId)
{
string empName = string.Empty;
Database abcDatabase;
DbCommand abcCommand = null;
try
{
abcDatabase = DatabaseFactory.CreateDatabase(abcConnectString);
abcCommand = abcDatabase.GetStoredProcCommand("abc.ws_get_web_empname");
abcCommand.CommandType = CommandType.StoredProcedure;
// in
abcDatabase.AddInParameter(abcCommand, "p_emp_id", DbType.VarNumeric, employeeId);
// out
abcDatabase.AddOutParameter(abcCommand, "p_emp_name", DbType.String, 65);
// run
abcDatabase.ExecuteNonQuery(abcCommand);
empName = abcDatabase.GetParameterValue(abcCommand, "p_emp_name").ToString();
//Added:
//empName = abcCommand.Parameters[0].Value.ToString();
//Log("EmpId=" + employeeId.ToString() + ", EmpName: " + empName);
}
Stored Procedure:
create or replace procedure ws_get_web_empname
(
p_emp_id in number,
p_emp_name out varchar2
)
as
begin
select name_formatted_pcl
into p_emp_name
from people
where people_id = p_emp_id;
exception
when NO_DATA_FOUND then
p_emp_name := '';
end;
Output is showing only First name + Initial of surname that is it shows "Julia K" and not the full name "Julia Kurakula". Let me know if you need further info to help me solve the issue.