Click here to Skip to main content
15,913,166 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Button Click for UART Pin
John-EE10-Feb-10 18:52
John-EE10-Feb-10 18:52 
AnswerRe: C# Button Click for UART Pin
Bekjong10-Feb-10 19:14
Bekjong10-Feb-10 19:14 
AnswerRe: C# Button Click for UART Pin
harold aptroot10-Feb-10 20:24
harold aptroot10-Feb-10 20:24 
GeneralRe: C# Button Click for UART Pin
OriginalGriff10-Feb-10 21:54
mveOriginalGriff10-Feb-10 21:54 
QuestionFun With User Controls Pin
Roger Wright10-Feb-10 18:36
professionalRoger Wright10-Feb-10 18:36 
AnswerRe: Fun With User Controls Pin
AspDotNetDev10-Feb-10 19:27
protectorAspDotNetDev10-Feb-10 19:27 
GeneralRe: Fun With User Controls Pin
Roger Wright11-Feb-10 2:08
professionalRoger Wright11-Feb-10 2:08 
Questioncalling web service Pin
Ramkithepower10-Feb-10 16:46
Ramkithepower10-Feb-10 16:46 
I am newbie to webservices
I am trying to learn about them, but got struck in the first place itself. Please help me out.

My service.cs in the web service.
--------------------------------
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://localhost:1458/forumservices/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {

//Uncomment the following line if using designed components 
//InitializeComponent(); 
}


[WebMethod]
public string welcome(string name)
{
return "Welcome " + name;
}

}

now on a button click from another web page

protected void Button1_Click(object sender, EventArgs e)
{

try
{
soapMessage =
@"
<?xml version=""1.0"" encoding=""utf-8""?>
<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">
<soap12:Body>
<welcome xmlns=""http://localhost:1458/forumservices/"">
<name>Rajas</name>
</welcome>
</soap12:Body>
</soap12:Envelope>";

WebClient mClient = new WebClient();



Response.Write(System.Text.Encoding.ASCII.GetString(mClient.UploadData("http://localhost:1458/forumservices/Service.asmx", "POST", System.Text.Encoding.ASCII.GetBytes(soapMessage))));
}
catch (System.Net.WebException ex)
{
if (ex.Response != null)
{
Stream strm = ex.Response.GetResponseStream();
StreamReader sr = new StreamReader(strm);
Response.Write(sr.ReadToEnd());
}
else
{
Response.Write(ex.InnerException.ToString());
}
}

}

The compilation is fine, but i keep getting some errors as below
"The remote server returned an error: (500) Internal Server Error."

Please help me out

I had posted the exam same thing in ASP.NET forum, but got no replies.
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.

AnswerRe: calling web service Pin
Pranay Rana10-Feb-10 18:05
professionalPranay Rana10-Feb-10 18:05 
Questionhow would you change your bindingsource for a textbox programmably Pin
tonyonlinux10-Feb-10 14:37
tonyonlinux10-Feb-10 14:37 
AnswerRe: how would you change your bindingsource for a textbox programmably Pin
Gaurav Dudeja India10-Feb-10 17:22
Gaurav Dudeja India10-Feb-10 17:22 
GeneralRe: how would you change your bindingsource for a textbox programmably Pin
tonyonlinux10-Feb-10 17:32
tonyonlinux10-Feb-10 17:32 
GeneralRe: how would you change your bindingsource for a textbox programmably Pin
tonyonlinux10-Feb-10 18:13
tonyonlinux10-Feb-10 18:13 
QuestionMoving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 9:12
shadowthief_0310-Feb-10 9:12 
AnswerRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 9:15
professionalKeith Barrow10-Feb-10 9:15 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 9:53
shadowthief_0310-Feb-10 9:53 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 10:08
professionalKeith Barrow10-Feb-10 10:08 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 10:35
shadowthief_0310-Feb-10 10:35 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 11:21
professionalKeith Barrow10-Feb-10 11:21 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 10:53
shadowthief_0310-Feb-10 10:53 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Eddy Vluggen10-Feb-10 11:14
professionalEddy Vluggen10-Feb-10 11:14 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 11:24
shadowthief_0310-Feb-10 11:24 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Keith Barrow10-Feb-10 11:38
professionalKeith Barrow10-Feb-10 11:38 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
shadowthief_0310-Feb-10 11:56
shadowthief_0310-Feb-10 11:56 
GeneralRe: Moving a file from a CD to a Folder somewhere on hardrive Pin
Eddy Vluggen10-Feb-10 12:00
professionalEddy Vluggen10-Feb-10 12:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.