Advertisement

07.26.2008 at 06:13AM PDT, ID: 23597636
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

The remote server returned an error: (401) Unauthorized.

Asked by priya-dls in Microsoft IIS Web Server, Active Server Pages (ASP), Network Software Firewalls

Tags:

We are testing this code from an XP system remoting to a 2003 server with a static IP.
 Here, DLSServer is an interface mechanism which has the CServer class which in turn contains the CallFunc() function which in turn calls the getval()  from an Interop COM service.
The below code has been tested on the localhost and found to be alright.  But on a remote host this code returns an error.

When windows firewall is on with "Dont allow exceptions"  the following was returned.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://122.166.3.204//dlsonline//dlsserver.soap">http://122.166.3.204//dlsonline//dlsserver.soap</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Connection to 122.166.3.204 Failed
</STRONG>
</UL>

<P>
The system returned:
<PRE><I>    (110) Connection timed out</I></PRE>

<P>
The remote host or network may be down.  Please try the request again.
<P>Your cache administrator is <A HREF="mailto:root">root</A>.

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Sat, 26 Jul 2008 11:21:36 GMT by blr.cc (squid/2.6.STABLE17)
</ADDRESS>
</BODY></HTML>

When Firewall is off  we got the following error :

The remote server returned an error: (401) Unauthorized.

Stack trace :

"\r\nServer stack trace: \r\n   at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessResponseException(WebException webException, HttpWebResponse& response)\r\n   at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)\r\n   at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage msg)\r\n\r\nException rethrown at [0]: \r\n   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n   at DLSServer.CServer.CallFunc(Int32 source, String mf, String mp1, String mp2, String mp3, String mp4)\r\n   at _Default.Button1_Click(Object sender, EventArgs e) in d:\\rnd\\wrk\\test\\Default.aspx.cs:line 35\r\n   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)\r\n   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)\r\n   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)\r\n   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)\r\n   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)\r\n   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

Kindly assist us with regard to the above,
Thanks a lot in advance
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
using System;
using System.IO;
using System.Net;
using System.Text;
using System.Data;
using System.Runtime.Remoting;
using DLSServer;
 
..
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
CServer mobj = new CServer();
string mstrip = "http://" + "122.166.3.204" + "//dlsonline//dlsserver.soap";   
string mpath = "d:\\test\\";    // path on the remote server
mobj = (CServer)Activator.GetObject(typeof(CServer), mstrip);
 
 
// the below line generates the error
string mrfile = mobj.CallFunc(1, "getval", mpath, mpath, mpath, mpath);
 
..
 
Loading Advertisement...
 
[+][-]07.26.2008 at 12:58PM PDT, ID: 22096052

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2008 at 01:00PM PDT, ID: 22096057

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft IIS Web Server, Active Server Pages (ASP), Network Software Firewalls
Tags: The remote server returned an error: (401) Unauthorized.
Sign Up Now!
Solution Provided By: dave4dl
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628