Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all.I have an issue with firing event in web service.am using the mCore™ SMS to test ussd input in my service.In windows form application,when i check the checkbox to fire new incoming ussd,its working okay.but the problem is in a web service,I have created a function on start which i connect with modem and that works okay.The problem is the the event which receives the ussd request,its not firing at all .Here is my code.


C#
public void <pre lang="cs">objSMS_NewUSSDReceived(object sender, mCore.NewUSSDReceivedEventArgs e)
       {
           string message = e.Message.ToString();
           string status = e.Status.ToString();


           if (message.Contains("Welcome user"))
           {
                 //MY FUNCTION TO CALL

           }
           else
           {

               //problem with ussd



           }
       }

When the service starts on debug,i call the function below which has the ussd request.However it does not trigger any event

  public void Test()
        {
            bool result = objSMS.SendUSSD("*1234#");
            if (result)
            {
            
                //it lands in this code below but nothen happens.The event "objSMS_NewUSSDReceived" is not triggered

                objSMS.NewUSSDReceived +=objSMS_NewUSSDReceived;
                objSMS.NewUSSDIndication = true;


            }
Posted
Comments
[no name] 6-Jul-14 13:45pm    
It's not a good way to fire event in webservice... You have to invoke this from outside any of the autoevent fire

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900