Click here to Skip to main content
15,917,731 members
Home / Discussions / ASP.NET
   

ASP.NET

 
NewsGoogle API - graph Pin
Member 395625710-Feb-10 18:17
Member 395625710-Feb-10 18:17 
GeneralRe: Google API - graph Pin
nainakarri10-Feb-10 18:58
nainakarri10-Feb-10 18:58 
GeneralRe: Google API - graph Pin
Member 395625710-Feb-10 19:36
Member 395625710-Feb-10 19:36 
GeneralRe: Google API - graph Pin
Anurag Gandhi10-Feb-10 20:42
professionalAnurag Gandhi10-Feb-10 20:42 
QuestionFind How many Enter Key Press Pin
sjs4u10-Feb-10 17:55
sjs4u10-Feb-10 17:55 
AnswerRe: Find How many Enter Key Press Pin
Anurag Gandhi10-Feb-10 18:19
professionalAnurag Gandhi10-Feb-10 18:19 
Questionon keypress enter to submit login details IE is working but in firefox not working Pin
Nath10-Feb-10 15:40
Nath10-Feb-10 15:40 
QuestionCalling webservice Pin
Ramkithepower10-Feb-10 15:33
Ramkithepower10-Feb-10 15:33 
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;<br />
using System.Web;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
<br />
[WebService(Namespace = "http://localhost:1458/forumservices/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
public class Service : System.Web.Services.WebService<br />
{<br />
    public Service () {<br />
<br />
        //Uncomment the following line if using designed components <br />
        //InitializeComponent(); <br />
    }<br />
<br />
    <br />
    [WebMethod]<br />
    public string welcome(string name)<br />
    {<br />
        return "Welcome " + name;<br />
    }<br />
    <br />
}


now on a button click from another web page

protected void Button1_Click(object sender, EventArgs e)<br />
    {<br />
        <br />
        try<br />
        {<br />
            soapMessage =<br />
            @"<br />
<?xml version=""1.0"" encoding=""utf-8""?><br />
<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""><br />
  <soap12:Body><br />
    <welcome xmlns=""http://localhost:1458/forumservices/""><br />
      <name>Rajas</name><br />
    </welcome><br />
  </soap12:Body><br />
</soap12:Envelope>";<br />
<br />
            WebClient mClient = new WebClient();<br />
            <br />
            <br />
<br />
            Response.Write(System.Text.Encoding.ASCII.GetString(mClient.UploadData("http://localhost:1458/forumservices/Service.asmx", "POST", System.Text.Encoding.ASCII.GetBytes(soapMessage))));<br />
        }<br />
        catch (System.Net.WebException ex)<br />
        {<br />
            if (ex.Response != null)<br />
            {<br />
                Stream strm = ex.Response.GetResponseStream();<br />
                StreamReader sr = new StreamReader(strm);<br />
                Response.Write(sr.ReadToEnd());<br />
            }<br />
            else<br />
            {<br />
                Response.Write(ex.InnerException.ToString());<br />
            }<br />
        }<br />
<br />
    }


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
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.

AnswerRe: Calling webservice Pin
Pranay Rana10-Feb-10 18:18
professionalPranay Rana10-Feb-10 18:18 
AnswerRe: Calling webservice Pin
sashidhar10-Feb-10 18:24
sashidhar10-Feb-10 18:24 
GeneralRe: Calling webservice Pin
Ramkithepower11-Feb-10 6:03
Ramkithepower11-Feb-10 6:03 
GeneralRe: Calling webservice Pin
sashidhar11-Feb-10 17:43
sashidhar11-Feb-10 17:43 
QuestionWorking with Memory Streams Pin
Hema Bairavan10-Feb-10 7:19
Hema Bairavan10-Feb-10 7:19 
AnswerRe: Working with Memory Streams Pin
Steve Wellens10-Feb-10 7:49
Steve Wellens10-Feb-10 7:49 
GeneralRe: Working with Memory Streams Pin
Hema Bairavan10-Feb-10 8:11
Hema Bairavan10-Feb-10 8:11 
GeneralRe: Working with Memory Streams Pin
Steve Wellens10-Feb-10 8:16
Steve Wellens10-Feb-10 8:16 
GeneralRe: Working with Memory Streams Pin
Hema Bairavan10-Feb-10 8:21
Hema Bairavan10-Feb-10 8:21 
AnswerRe: Working with Memory Streams Pin
i gr810-Feb-10 18:18
i gr810-Feb-10 18:18 
GeneralRe: Working with Memory Streams Pin
Hema Bairavan10-Feb-10 19:06
Hema Bairavan10-Feb-10 19:06 
QuestionInvalid registration key Pin
nakins10-Feb-10 5:00
nakins10-Feb-10 5:00 
QuestionOther alternative to WS-Security [modified] Pin
raquidd2210-Feb-10 4:04
raquidd2210-Feb-10 4:04 
AnswerRe: call web service from one server Pin
N a v a n e e t h10-Feb-10 4:23
N a v a n e e t h10-Feb-10 4:23 
QuestionHow to play movie clips and swf files in asp.net Pin
CHANDUA10-Feb-10 2:27
CHANDUA10-Feb-10 2:27 
AnswerRe: How to play movie clips and swf files in asp.net Pin
Richard MacCutchan10-Feb-10 4:45
mveRichard MacCutchan10-Feb-10 4:45 
QuestionPopUp Pin
Civic0610-Feb-10 2:12
Civic0610-Feb-10 2:12 

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.