Has anyone used PennySMS's web services? (https://www.pennysms.com/docs) I'm having some difficulty doing a successful HttpPost request.
Update: I'm a n00b to Web Services. I don't even know if I can complete this type of request server-side. I've replaced the actual info in the params with example info.
protected void bText_Click(object sender, EventArgs e)
{
string XML = "<?xml version=\"1.0\"?>"
+"<methodCall>"
+"<methodName>send</methodName>"
+" <params>"
+" <param>"
+ " <value><string>MY KEY</string></value>"
+" </param>"
+" <param>"
+ " <value><string>[email protected]</string></value>"
+" </param>"
+" <param>"
+ " <value><string>555555555</string></value>"
+" </param>"
+" <param>"
+" <value><string>Test Message</string></value>"
+" </param>"
+" </params>"
+"</methodCall>";
SendText("http://api.pennysms.com/xmlrpc", "XML");
}
public void SendText(string _URL, string _parameters)
{
WebRequest request = WebRequest.Create(_URL);
request.Method = "POST";
string postData = _parameters;
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "text/xml";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
}