Joke Collection Website - Blessing messages - C#winform calls telecom kuanle's webservice to send short messages. Why is the return value always 0? Does vs2008 need any configuration?

C#winform calls telecom kuanle's webservice to send short messages. Why is the return value always 0? Does vs2008 need any configuration?

If your parameters are useful account number, password, mobile phone number for sending SMS, and SMS content, is your API out of date? Why not set a breakpoint? I'll throw you a piece of my code for your reference. See if it works for you.

org . winic . service 2 . service 1 ws = new web application 1 . org . winic . service 2 . service 1();

message manager message = new message manager();

int userId = Convert。 ToInt32 (session ["userid"]);

Data table dt = message. get account(userId);

String name = dt. Line [0]["MessageName"]. ToString();

The string pwd = dt. Line [0]["MessagePwd"]. ToString();

//Return a result, the first parameter is the mobile phone account number, the second parameter is the password, the third parameter is the mobile phone number, and the fourth parameter is the mobile phone content.

String result = ws. SendMessages (name, password, txtMoble. Text, short message. Text, "";

Switch (result)

{

Case "-0 1":

Page. RegisterStartupScript("alert ","< script & gt alert ('System prompt: the current account balance is insufficient!' )& lt/script & gt; ");

Break;

Case "-02":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: the current user ID is wrong!' )& lt/script & gt; ");

Break;

Case "-03":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: the current password is wrong!' )& lt/script & gt; ");

Break;

Case "-04":

Page. RegisterStartupScript("alert ","< script > alert ('system prompt: insufficient parameters or wrong parameter content type!' )& lt/script & gt; ");

Break;

Case "-05":

Page. RegisterStartupScript("alert ","< script & gt alert ('System prompt: the format of mobile phone number is incorrect!' )& lt/script & gt; ");

Break;

Case "-06":

Page. RegisterStartupScript("alert ","< script & gt alert ('System prompt: the SMS content is not coded correctly!' )& lt/script & gt; ");

Break;

Case "-07":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: SMS content contains sensitive characters!' )& lt/script & gt; ");

Break;

Case "-08":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: No data received!' )& lt/script & gt; ");

Break;

Case "-09":

Page. RegisterStartupScript("alert ","< script & lt alert ('system prompt: system maintenance ...'))

Break;

Case "-10":

Page. RegisterStartupScript("alert ","< script & gt alert ('System prompt: the number of mobile phone numbers is too long!' )& lt/script & gt; ");

Break;

Case "-1 1":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: SMS content is too long!' )& lt/script & gt; ");

Break;

Case "-12":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: Other error!' )& lt/script & gt; ");

Break;

Case "-13":

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: file transfer error!' )& lt/script & gt; ");

Break;

Default value:

Page. RegisterStartupScript("alert ","< script & gtAlert ('System prompt: sent successfully!' )& lt/script & gt; ");

SendManager SendManager = new SendManager();

string moble = txtMoble。 Text;

string _message = txtMessage。 Text;

int Result = sendManager。 AddMessageRecord (user Id, name, mobile, _ message, 1, date and time. Now);

Break;