locked
Send SMS using asp.net c# RRS feed

  • Question

  • User1580341235 posted

    Hi everyone,

    I tried to send SMS using ASP.NET C# and googled and find the below link,

    Sending-SMS-using-NET-through-a-Web-service

    now I am getting the error "System.Net.WebException: The request failed with HTTP status 417"...

    Kindly help me .... Also I want is this webservice method free....? Do I need to create any account as with way2sms...?

    please clarify....

    Saturday, February 16, 2013 6:37 AM

Answers

  • User-782344923 posted

    Hi again,

    From that post at codeproject, it seems that code is not either running to anybody or if running then doesn't send / receive any sms after reading comments regarding to that post at bottom of article.

    Try any other resource full links like

    http://www.codeproject.com/Articles/19023/Sending-SMS-using-NET
    
    http://www.ozekisms.com/index.php?owpn=230
    
    http://anindita9.wordpress.com/2011/12/19/sending-sms-from-asp-net-c-4-0-application-to-mobile-using-xml-api/
    
    http://www.c4sms.com/codeExamples.asp
    
    http://www.c-sharpcorner.com/UploadFile/b8d90a/send-sms-using-C-Sharp-net/

    Cheers

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 16, 2013 7:39 AM

All replies

  • User-782344923 posted

    Hi Mahesh,

    When using WebServices and calling some Web Methods, you may come across this exception:

    The request failed with HTTP status 417: Expectation failed.
    

    This error occur when 100-Continue property is set to true. To resolve this issue try any one them technique. Putting this code before an web request:

    System.Net.ServicePointManager.Expect100Continue = false;
    

    Or adding the following lines to the web.config within 

    <configuration>
    <system.net>
        <settings>
            <servicePointManager expect100Continue="false" />
        </settings>
    </system.net>

    Let me know if any query still remains.

    Cheers

    Saturday, February 16, 2013 6:44 AM
  • User1580341235 posted

    Hi ,

    now I am getting this error,

    System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.IOException: There is not enough space on the disk. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count) at System.IO.FileStream.FlushWrite(Boolean calledFromFinalizer) at System.IO.FileStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.StreamWriter.Dispose(Boolean disposing) at System.IO.TextWriter.Dispose() at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources) at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources) at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Sending_SMS.net.webservicex.www.SendSMS.SendSMSToIndia(String MobileNumber, String FromEmailAddress, String Message) in d:\Mahesh\Maheshkumar P(trainee)\.net framework\ASP\workouts\Sending SMS\Web References\net.webservicex.www\Reference.cs:line 78 at Sending_SMS._Default.Button1_Click(Object sender, EventArgs e) in d:\Mahesh\Maheshkumar P(trainee)\.net framework\ASP\workouts\Sending 

    Saturday, February 16, 2013 6:51 AM
  • User-782344923 posted

    Hi again,

    Try this link

    http://forums.asp.net/t/1287519.aspx/1
    
    

    Or if issue is not resolve then please post your code here.

    Cheers

    Saturday, February 16, 2013 6:57 AM
  • User1580341235 posted

    Hi,

    I am just using the same code in this link (http://www.codeproject.com/Articles/7346/Sending-SMS-using-NET-through-a-Web-service) ......

    Saturday, February 16, 2013 7:10 AM
  • User-782344923 posted

    Hi again,

    From that post at codeproject, it seems that code is not either running to anybody or if running then doesn't send / receive any sms after reading comments regarding to that post at bottom of article.

    Try any other resource full links like

    http://www.codeproject.com/Articles/19023/Sending-SMS-using-NET
    
    http://www.ozekisms.com/index.php?owpn=230
    
    http://anindita9.wordpress.com/2011/12/19/sending-sms-from-asp-net-c-4-0-application-to-mobile-using-xml-api/
    
    http://www.c4sms.com/codeExamples.asp
    
    http://www.c-sharpcorner.com/UploadFile/b8d90a/send-sms-using-C-Sharp-net/

    Cheers

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 16, 2013 7:39 AM
  • User-419562455 posted

    Sms Sending Using ASP.NET    Click Here

    1.two textbox and one button

    .cs

    -----

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Net;
    using System.IO;

    public partial class sending_sms2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void send(string uid, string password, string message, string no)
        {
         
        

            HttpWebRequest myReq =
           (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password +
           "&msg=" + message + "&phone=" + no + "&provider=way2sms");



            HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
            System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
            string responseString = respStreamReader.ReadToEnd();
            respStreamReader.Close();
            myResp.Close();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            //for (int i = 0; i < 10; i++)
            //{
                send("YOURUSERNAME","PASSWORD",TextBox1.Text,TextBox2.Text);
            //}
            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('sms sent successfully...');", true);

        }
    }

    Monday, April 29, 2013 6:48 AM
  • User-193763551 posted

    hi @ Jack Hunt

    i tried ur code but i am getting an error saying

    The remote server returned an error: (503) Server Unavailable.

    Wednesday, November 13, 2013 4:12 AM