Member 7701783 Ответов: 0

Несоответствие данных ответа веб-службы при многократном запросе


We have web service for mobile app and it was working fine till we change the server. Recently we have moved our server to Azure platform VM and SQL MI after that we are facing the problem in the web service response. The web service one response wrongly mapping to another request's response e.g when user 1 hitting the web service with respective Id value and same time user2 hit with his ID then user 1 and user 2 both getting the same response of either user1 or user2.This issue occurs only 10 out of 200 hits approx. Kindly suggest me if anything wrong or where the mistake has done. below is the code, (here I have included some logs for finding the response)

В соответствии с приведенной ниже функцией "GetJobAssignmentDetails_fhits" номер "Model_No" является значением первичного ключа для получения соответствующих сведений о пользователе. Это функция, используемая для получения деталей, подобных вышеупомянутым(custid, address и т. д.) для соответствующего пользователя.

Мы также проверяем этот угол мобильного устройства, но, похоже, в мобильном приложении нет никакой проблемы, потому что мы использовали браузер, чтобы попасть в веб-сервис с соответствующим параметром с помощью wsdl, и там сам ответ неверен. раньше мы постоянно попадали в веб-сервис через браузер с уникальным значением параметра 2 разных пользователей на рабочем столе, и там же мы получали один и тот же ответ для каждого в определенный момент времени.

Ниже приведен код,

Что я уже пробовал:

<pre>public class JobSeq
{
private string sJobCode;
private string sCustCode;
private string sCustName;
private string sContactPerson;
private string sContactNo;
private string sCustAddress;
private int sJSno;
[System.Xml.Serialization.XmlElementAttribute]
public int JSno
{
get { return sJSno; }
set { sJSno = value; }
}
//Job Code
[System.Xml.Serialization.XmlElementAttribute]
public string JobCode
{
get { return sJobCode; }
set { sJobCode = value; }
}
//Customer Code
[System.Xml.Serialization.XmlElementAttribute]
public string CustomerCode
{
get { return sCustCode; }
set { sCustCode = value; }
}
//Customer Name
[System.Xml.Serialization.XmlElementAttribute]
public string CustomerName
{
get { return sCustName; }
set { sCustName = value; }
}
//Customer Address
[System.Xml.Serialization.XmlElementAttribute]
public string Address
{
get { return sCustAddress; }
set { sCustAddress = value; }
}
//Contact Person
[System.Xml.Serialization.XmlElementAttribute]
public string ContactPerson
{
get { return sContactPerson; }
set { sContactPerson = value; }
}
//Contact No
[System.Xml.Serialization.XmlElementAttribute]
public string ContactNo
{
get { return sContactNo; }
set { sContactNo = value; }
}
[System.Xml.Serialization.XmlElementAttribute]
public string RowCount { get; set; }
[System.Xml.Serialization.XmlElementAttribute]
public string TotRowCount { get; set; }
[System.Xml.Serialization.XmlElementAttribute]
public string NewJob { get; set; }
[System.Xml.Serialization.XmlElementAttribute]
public string Accecptjob { get; set; }
}
[WebMethod(Description = "Testing", CacheDuration = 0, EnableSession = false)]
public JobDetails_Test GetJobAssignmentDetails_fhits(string Model_No, bool isHistory, string utcStTime, string utcEndTime, string currLatLng, int PageNo, int RowCount, bool isNewjob)
{
// Trinetra_App.BAL.Configurations objC = new Trinetra_App.BAL.Configurations();
DateTime dtStTime = DateTime.Now;
ModelNumber = Model_No.ToString();
DataSet ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["ConString"].ToString());
SqlCommand command = new SqlCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "rvlf_sp_GetDetails1";
command.Connection = conn;
DataTable dtTable = new DataTable();
JobDetails_Test objJobDetails_std1 = new JobDetails_Test();
Hashtable param_std1 = new Hashtable();
try
{
param_std1.Add("@cModelCode", Model_No);
command.Parameters.AddWithValue("@cModelCode", Model_No);
if (isHistory == true)
{
command.Parameters.AddWithValue("@bIsHistory", "1");
command.Parameters.AddWithValue("@dStDate", utcStTime);
command.Parameters.AddWithValue("@dEndDate", utcEndTime);
param_std1.Add("@bIsHistory", "1");
param_std1.Add("@dStDate", utcStTime);
param_std1.Add("@dEndDate", utcEndTime);
}
else
{
command.Parameters.AddWithValue("@cCurrLatLng", currLatLng);
command.Parameters.AddWithValue("@Isnewjob", isNewjob);
param_std1.Add("@cCurrLatLng", currLatLng);
param_std1.Add("@Isnewjob", isNewjob);
}
//ds = objC.ExecuteDataSet(param_std1, "rvlf_sp_GetJobDetails1", true);
SqlDataAdapter adapter = new SqlDataAdapter();
adapter.SelectCommand = command;
adapter.Fill(ds);
if (ds.Tables.Count != 0)
{
if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
{
StringWriter sw = new StringWriter();
ds.WriteXml(sw, XmlWriteMode.IgnoreSchema);
List<JobSeq> objJobAssignment_std1 = new List<JobSeq>();
PagedDataSource objPds = new PagedDataSource();
objPds.DataSource = ds.Tables[0].DefaultView;
objPds.AllowPaging = true;
objPds.PageSize = RowCount;
objPds.CurrentPageIndex = PageNo - 1;
foreach (DataRow item in ds.Tables[0].Rows)
{
JobSeq objJobSeq = new JobSeq();
objJobSeq.JobCode = item["JobCode"].ToString();
objJobSeq.JSno = Convert.ToInt32(item["Sno"].ToString());
objJobSeq.CustomerCode = item["CustId"].ToString();
objJobSeq.CustomerName = item["CustName"].ToString();
objJobSeq.Address = item["CustomerAddress"].ToString();
objJobSeq.ContactPerson = item["ContactPerson"].ToString();
objJobSeq.ContactNo = item["Phone"].ToString();
if (isHistory)
{
objJobSeq.SignatureBytes = new byte[] { };
objJobSeq.AttachmentBytes = new byte[] { };
}
objJobAssignment_std1.Add(objJobSeq);
}
objJobDetails_std1.Assignment = objJobAssignment_std1;
if (ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0)
{
objJobDetails_std1.NewJob = Convert.ToInt32(ds.Tables[1].Rows[0]["NewJob"].ToString());
objJobDetails_std1.Accecptjob = Convert.ToInt32(ds.Tables[1].Rows[0]["Accecptjob"].ToString());
}
else
{
objJobDetails_std1.NewJob = 0;
objJobDetails_std1.Accecptjob = 0;
}
objJobDetails_std1.Response_Status = "Success";
}
else
{
objJobDetails_std1.Response_Status = "Data not available";
}
}
else
{
objJobDetails_std1.Response_Status = "Data not available";
}
}
catch (Exception ex)
{
objJobDetails_std1.Response_Status = ex.Message.ToString();
StackFrame stackFrame = new StackFrame();
MethodBase methodBase = stackFrame.GetMethod();
ModelNumber = string.Empty;
}
finally
{
param_std1.Clear();
param_std1 = null;
ds.Dispose();
ds = null;
}
return objJobDetails_std1;
}

0 Ответов