[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Response.redirect to a url within web service method leads to HTTP 500 - Internal server error

Posted on 2005-04-05
5
Medium Priority
?
2,318 Views
Last Modified: 2011-10-03
Hi,

I have a simple web service that redirects the response to a web page.

[WebMethod]
public string HelloWorld()
{
      this.Context.Response.Redirect ("http://www.hp.com", true);
      return "hello world";
}

But invoking the method gives me a

HTTP 500 - Internal server error
Internet Explorer


What am I doing wrong?

THANKS!
Andrew

0
Comment
Question by:andrewting
5 Comments
 
LVL 7

Assisted Solution

by:maXXXeE
maXXXeE earned 375 total points
ID: 13713859
r u sure that u can redirect to another page in web service?

can i know, what exactly u r trying to achieve in ur application?
0
 
LVL 12

Accepted Solution

by:
laotzi2000 earned 375 total points
ID: 13714005
I don't think you could or should do that in a web service application.
A web service does not have a user interface anyway, so what's the point
of redirecting to another page?
0
 
LVL 9

Expert Comment

by:Type25
ID: 13716997
You might want to look at WebRequest  to return the website.
0
 

Author Comment

by:andrewting
ID: 13717974
Thanks for the comments.  You are right.  I thought about it a little more and redirecting to a web page in a web site is a little weird.

I have a web site that we built, but I now need to be able to preload information into the web site by a third-party application using a web service.  I need to be able to

1.  Programmatically log into the website (the website uses forms authentication) and load an XML file into the website via a web service.

This should be easy a simple web service that says (and secured using SSL) should work.
eg.  LoadXML (string userName, string password, string XML)

2.  Start up the website in a browser (already logged in for the user) and goto an aspx page that presents the loaded information to the user.

This is a little more confusing, how do I programmatically log a user in?  At first I thought of having a web service like above, and once the credentials are authenticated, I would redirect the user to the website page using the session information.  But this doesn't seem to be the right approach...

I don't want to encode the username/password in the URL in plain text....Can anyone help me with this?  

THANKS!
Andrew



0
 

Author Comment

by:andrewting
ID: 13719472

I couldn't figure out how to change the title of my question.  I was worried that no one would respond.

Here is the new link.
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21378882.html
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month18 days, 9 hours left to enroll

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question