|
hi friends i have tried to send sms to india through my application but unable to send it the code is as follows
protected void Send_Click(object sender, System.EventArgs e)
{
try
{
SmsTest.net.webservicex.www.SendSMS smsIndia= new SmsTest.net.webservicex.www.SendSMS();
SmsTest.com.webservicex.www.SendSMSWorld smsWorld = new SmsTest.com.webservicex.www.SendSMSWorld();
if(rdoType.SelectedValue == "1")
smsIndia.SendSMSToIndia(txtMobileNo.Text.Trim(), txtEmailId.Text.Trim(), txtMessage.Text);
else
smsWorld.sendSMS(txtEmailId.Text.Trim(), txtCountryCode.Text.Trim(), txtMobileNo.Text.Trim(), txtMessage.Text);
lblMessage.Visible = true;
lblMessage.Text="Message Send Succesfully";
}
catch(Exception ex)
{
lblMessage.Visible = true;
lblMessage.Text="Error in Sending message"+ex.ToString();
}
}
protected void rdoType_SelectedIndexChanged(object sender, System.EventArgs e)
{
if(rdoType.SelectedValue =="1")
txtCountryCode.Enabled = false;
else
txtCountryCode.Enabled = false;
}
}
}
and the exception is
Error in Sending messageSystem.Net.WebException: The remote name could not be resolved: 'www.webservicex.net' at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SmsTest.net.webservicex.www.SendSMS.SendSMSToIndia(String MobileNumber, String FromEmailAddress, String Message) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\smstest\e1b64363\4f679e02\App_WebReferences.dvkrcwdj.1.cs:line 46 at SmsTest.WebForm1.Send_Click(Object sender, EventArgs e) in c:\Documents and Settings\Tapi-net\Desktop\SmsTest\SmsTest\SendSms.aspx.cs:line 52
so will u please help me out.
thanking you in advance.
Amol Pate
|
|
|
|
|
Your code is a black box, no-one here can help you unless they have used that webservice. The problem is lower down than this code. Your best bet is the documentation of the web service you are trying to use.
I can see www.webservicex.net, I wonder if you have network issues ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to bind a dataset in SQL reporting services. My procedure outputs data from 3 select statements. But when i try to bind it in
reporting services,the dataset shows the resultset of only the 1st select statement
of the proc.
In all my reports before, I had used only 1 select statement to output data in the proc
and they had all worked fine in reporting services. What should I do to get the
resultset form all three select statements in the dataset.
|
|
|
|
|
I was trying to create a Generic class and a Generic method inside. Please check the following code
class Program
{
static void Main(string[] args)
{
MyClass<int, string> m1 = new MyClass<int, string>();
Console.WriteLine(m1.Calculate(10));
Console.Read();
}
}
class MyClass<T,F>
{
public F Calculate(T t)
{
ObjArr.Add(t);
}
}
In this I am giving two generic types for MyClass. I have supplied int and string there. My generic function (Calulate()) returns type F, which is instantiated as string. Now how will I return the type from Calculate() method ?, because we are not getting any objects for type F ? Any help would be appreciated.
-- modified at 2:10 Wednesday 3rd October, 2007
|
|
|
|
|
Did you escape "<" with "&lt;"? The code isn't correct as-is.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
TJoe wrote: Did you escape "<" with "<"? The code isn't correct as-is.
OOPS.. I forgot that. Now check please
|
|
|
|
|
Your code doesn't make much sense, so I'm not sure what to tell you. If you explain what you would like the method to do (e.g. add two numbers then return the string representation), then I can probably help.
I don't think you will be able to use your code as-is. Basically, you would need to write code that knows how to convert T to F for every class in .Net. Because I could define the class as "Class<Hashtable, Boolean>". There's no relation between T and F.
-- modified at 2:29 Wednesday 3rd October, 2007 - damn <
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
TJoe wrote: If you explain what you would like the method to do (e.g. add two numbers then return the string representation), then I can probably help.
I was experimenting generics. So i thought of making a method in which if parameters are integer it will return the sum of two numbers as integer, if both are string it will combine both strings and return ? But I feel this is stupidity or is it possible to do like this ? If not what will be the actual use of Generics ?
|
|
|
|
|
I suggest reading this[^] or search for other articles on generics.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
i am devloping the application in which i m recieving the sms from the mobilei m devloping application in c# anybody can help me.
|
|
|
|
|
The way to receive SMS, is to be connected to the mobile phone network, and have a phone number. Have you accepted this job from a project site, or have you just decided to do it, without doing any research in to feasibility ?
There are libraries for sending SMS via paid gateways, I don't see how you can receive SMS on a computer that is not connected to the phone network. How can it be addressed to you if you don't have a number ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i have done all the task ,it is sending the message but not receiving the message i have written the following event for receiving but it is not working
private void oGsmModem_NewMessageReceived(ATSMS.NewMessageReceivedEventArgs e)
{
txtMsg.Text = "Message from " + e.MSISDN + ". Message - " + e.TextMessage + System.Environment.NewLine;
}
|
|
|
|
|
It is possible that the event never get triggered.
What is connected to your computer in order to receive/send messages?
I am using a GSM modem where i can use only AT commands. There is an AT command available that pass me an event when a message is received.
Provide more information about your project.
|
|
|
|
|
Hi All.
I have a problem in my Web Page.
I Want reload data from DataBase after 15 seconds to WebPage. otherwise, my page must update new data from database to page after 15 seconds. But I don't know How do it?, I must use AJAX ?. How to Create above Page?.
I very need to sovel this problem as soon as.
Hope you help me.
If you have source code, you can show me.
thanks.
|
|
|
|
|
Not really a C# question but I'll help anyway.
You need to add a META tag inside that page's HEAD section. For example:
This little snippet will reload CodeProject.com every 15 seconds.
|
|
|
|
|
But in WebPage have using <marquee> tag to scroll page.
I want reload data in page at time, then position of all records in page not change <-- because page load then setting all position of records.
Example:
time A:
Position records.
Record 1
Record 2
Record 3
....
time B: <--- at time update data.
Record 2
Record 3
....
if using javaScript -- meta --> Position Record of B is.
time B:
Position records.
Record 1
Record 2
Record 3
....
|
|
|
|
|
You can use javascript timer and submit the page after 15 second and on page load you can update the data. not need to use ajax.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
But in WebPage have using <marquee> tag to scroll page.
I want reload data in page at time, then position of all records in page not change <-- because page load then setting all position of records.
Example:
time A:
Position records.
Record 1
Record 2
Record 3
....
time B: <--- at time update data.
Record 2
Record 3
....
if using javaScript -- meta --> Position Record of B is.
time B:
Position records.
Record 1
Record 2
Record 3
....
|
|
|
|
|
From the docs the definition of Math.Round
The integer nearest a. If a is halfway between two integers, one of which is even and the other odd, then the even number is returned.
So 4.5 rounds to 4 and 3.5 rounds to 4. Why?
|
|
|
|
|
Because it uses the Banker's Rounding algorithm to do the rounding. It's overrideable so you can use your own round method(s).
|
|
|
|
|
|
I learned banker's rounding in High school, so it just seems natural to me. Check out this[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hello:
I have here a problem where I am using web services.
From this example you can see that webservices is very tolerant of extra fields or missing fields. One issue though is that if you run one of the webservices and then update the other project's web reference it generates partial class code for your remote object in the namespace of the webservice. This is a problem.
For instance:
If you run the solution Version1 and then open the solution
Version2 and update the Web Reference in the project (you have to show hidden files) you get a file called Reference.cs.
In Reference.cs the system generates a wrapper for the class Foo
/// <remarks>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml","2.0.50727.1378")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class Foo {...}
The problem is that when it does this it will return this object as when you call HelloWorld.
static void Main(string[] args)
{
ConsoleApplication1.localhost.Service1 s1 = new Service1();
MyLibrary.Foo f1 = new MyLibrary.Foo();
f1.Prop1 = "New";
MyLibrary.Foo f2 = (MyLibrary.Foo)s1.HelloWorld( f1);
System.Console.WriteLine("F1.Prop1=" + f2.Prop1);
}
Which is not what you want. The intended object is MyLibrary.Foo not ConsoleApplication1.localhost.Foo. Please figure out how prevent VS from creating the wrapper or any other solution.
Below are the project codes:
"Version1" Solution:
Webservices:
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;
using MyLibrary.Lib;
namespace Version1
{
///
/// Summary description for Service1
///
[WebService(Namespace = "http://localhost/")]
[ToolboxItem(false)]
public class Service1 : System.Web.Services.WebService
{
[WebMethod(EnableSession = true)]
[XmlInclude(typeof(Foo))]
public MyLibrary.Lib.FooHelloWorld(MyLibrary.Lib.Foo foo1)
{
foo1 = "Updated";
return foo1;
}
}
}
"MyLibrary.cs"
using System;
using System.Data;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
namespace MyLibrary
{
public class Foo
{
private string m_prop1 = null;
public string Prop1
{
get { return m_prop1; }
set { m_prop1 = value; }
}
private string m_prop2 = null;
public string Prop2
{
get { return m_prop2; }
set { m_prop2 = value; }
}
public Foo()
{
m_prop1 = "abc";
m_prop2 = "cde";
}
}
}
Console application: "Program.cs"
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using MyLibrary.Lib;
namespace ConsoleApplication1
{
static void Main(string[] args)
{
ConsoleApplication1.localhost.Service1 s1 = new Service1();
MyLibrary.Foo f1 = new MyLibrary.Foo();
f1.Prop1 = "New";
MyLibrary.Foo f2 = (MyLibrary.Foo)s1.HelloWorld( f1);
System.Console.WriteLine("F1.Prop1=" + f2.Prop1);
}
}
*** NOte *** localhost is the name of the web services when i add reference.
If you can provide solution in this Version1 solution it will work also on Version2 solution.
Hope anyone can save me from hell... Thanks
|
|
|
|
|
How to make a random number generate? And also, every time it is called, will it generate a new random number? (between 1 and 20, please). Thanks in advance.
|
|
|
|
|