I am currently working on a C # / php / soap project. The main app is a console app and there is a web interface to manage the PSP console app.
Inside the console app, is a static list array, when php web interface posts SOAP message, then it calls the function inside the console app to update the database and then list ARA. However, this is working because it is setting the price, though the console app does not see it has been changed.
It looks like static list to be used within the Array SOAP services only, and do not actually have access to stable Array which is looking console app
I How to update this static variable so that the console application can see that it has been modified.
Thank you for any assistance you can provide.
UPDATE The code requested is as follows. Below is the public web method The SoapHandler method is called in the above code, this class is within the console application UPDATE I tried to use a singleton, but it had the same problem, it seems that the only way In ManageEmail Class I it Has been added, When I use the list array, so I'm following However these changes have not made any difference. Without the raw diagnosis I think that you have a problem where one example of a class is near. Value referenced in the other category A good place to see it Maybe you are always referring to the same example of class. I think one of the values is a static variable, but it is an immediate variable (i.e. a list)
[WebMethod] Public listing & lt; Sophandler SAPAstats Details & gt; Try againMailQueu (Int E-mail ID) {SOAPHandler Sophandler = New Soph Handler (); & Lt; SoapHandler.SoapStatusDetails & gt; Position = soaphardaller AdmelBackTouchui (Email ID); Return status; }
public list. & Lt; SoapStatusDetails & gt; AddEmailBackToQueue (int emailId) {list & lt; SoapStatusDetails & gt; Status = new list & sotstatusDetails & gt; (); {String query = "UPDATE emailqueue SET condition = status, RetryCount = @ count WHERE id = @ id"; (ConnectDb db = new ConnectDb (appSettings)) using {(MySqlCommand cmd = new MySqlCommand (query, db.conn)) using {cmd.Parameters.AddWithValue ( "@ situation", ManageEmail.EmailStatus.Queued.ToString ()); Cmd.Parameters.AddWithValue ("Count", 0); Cmd.Parameters.AddWithValue ("@ id", email id); Cmd.ExecuteNonQuery (); ManageEmail.queuedEmailIds.Add (EmailId); Event. Add (New Sopestats Details () {status = SoapStatus.Success.ToString (), errorMessage = ""}); }}} Catch (MySqlException ex) {string error = String.Format ( "Unable to put the email back in line for the email: ID {0} MySQL error :. {1}", EmailId, ex.Message); Library.logging (classDetails + MethodInfo.GetCurrentMethod (.name, error); Library.setAlarm (error, "Critical", MethodInfo.GetCurrentMethod (.name);); Event. Add (New Sopestats Details () {status = SoapStatus.Failure.ToString (), errorMessage = ex.Message}); } Hold (exception pre) {string error = string.Format ("unable to return email to queue: id {0}. General error: {1}", emailId, ex.Message); Library.logging (classDetails + MethodInfo.GetCurrentMethod (.name, error); Library.setAlarm (error, "Critical", MethodInfo.GetCurrentMethod (.name);); Event. Add (New Sopestats Details () {status = SoapStatus.Failure.ToString (), errorMessage = ex.Message}); } Return status; }
ManageEmail.queuedEmailIds.Add (EmailId); Fixed variable that never sees the soap service but the console is being replaced by the application It goes that this has changed.
public list & lt; Int & gt; QueuedEmailIds = New List & lt; Int & gt; (); Public stable management email example; Private Management E-mail () {} Public Stable Management E-mail Instance {get {if (example == blank) {instance = new ManageEmail (); } Return Example; }}
ManageEmail.Instance.queuedEmailIds.Add (emailId);
Comments
Post a Comment