C#网络服务/网站? [英] C# web service/website ?

查看:58
本文介绍了C#网络服务/网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对网站和网络服务有一个奇怪的问题。


他们都在同一台服务器上,运行Windows server 2003.该网站是

设置为服务器的默认网站。


我在几个不同的环境中运行相同的代码,它就是这样

发生这是我们遇到问题的生产服务器。不理想,

通常。


这是怎么回事。


当代码试图访问Web服务时,它获得302重定向。回复
来自IIS的



如果你去一台可以看到生产服务器的机器浏览器和

输入网络服务的地址,而不是获取网页

服务界面页面,您将被重定向到默认网站并向错误页面抛出

。哪个没有出现,因为你还没有登录:D


我最好通过数据库活动查看网络服务

正在启动,并没有明显抛出错误,尽管它可能会巧妙地抛出一个错误。在任何情况下,它都没有记录任何地方,如果它发现错误,那就是
应该这样做。


这个东西是通过wazzoo来保证的 - SSL,只有特定的IP地址

允许,整点。


任何想法?


我'我打算在其他一个新闻组中交叉这个只是为了让

确保我已经覆盖了所有的基地。

-

C.伍迪巴特勒

I have a strange problem with a website and a web service.

They''re both on the same server, running Windows server 2003. The website is
set up as the default website for the server.

I''ve got the same code running in several different environments, it just so
happens this is the production server we''re having problems with. Not ideal,
typically.

What happens is this.

When code tries to access the web service, it gets a "302 redirect" response
from the IIS.

If you go to a browser on a machine that can see the production server and
just type in the address of the web service, rather than getting the web
service interface page you get redirected to the default website and thrown
to the error page. Which doesn''t come up, because you''re not logged in :D

As best I can tell from looking thru the database activity the web service
is firing up, and not obviously throwing an error, altho it may be subtly
throwing an error. In any event, it''s not logging anything anywhere, which is
should do if it catches an error.

This thing is secured out the wazzoo - SSL, only specific IP addresses
allowed, the whole bit.

Any ideas?

I''m going to crosspost this in one of the other news groups just to make
sure I''ve got all my bases covered.
--
C. Woody Butler

推荐答案

嗨伍迪,


首先,我想要确认我对您的问题的理解。从

您的描述中,我了解到在某个服务器上,您的网络服务是重新定向到另一个页面的
。如果有任何误解,请感觉

免费让我知道。


由于这个问题只发生在您的生产服务器上,我认为这个

可能是IIS上的配置错误。请在机器上打开IIS

配置,右键单击Web服务,然后单击

目录选项卡。在顶部,当连接到此资源时,内容

应来自选项必须设置为指定目录。它可能已被设置为重定向到URL的
。发生重定向。


如果不是这样,您能否向我提供有关

您的网络服务的更多信息?它是一个web服务项目还是一个

ASP.NET项目中的一些asmx页面?如果是这样,表单身份验证ASP.NET应用程序也可能导致

此重定向。


HTH。


Kevin Yu

=======

此帖子已提供按现状没有保证,也没有赋予

权利。

Hi Woody,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that on a certain server, your webservice is
redirected to another page. If there is any misunderstanding, please feel
free to let me know.

Since this issue only happens on your production server, I assume this
might be a configuration error on the IIS. Please open the IIS
configuration on the machine, right click on the webservice and click the
Directory tab. on the top, "When connecting to this resource, the content
should com from" option has to be set to "The designated directory". It
might have been set to "A redirection to a URL" and the redirection occurs.

If that is not the case, could you provide me with more information about
your web service? Is it a webservice project or some asmx pages in an
ASP.NET project? If so, a forms authentication ASP.NET app might also cause
this redirection.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


就是这样。很简洁的总结:)。


我会检查配置并通知你。我很确定它已经设置为

从asmx页面所在的目录中获取内容,而不是在其他任何地方重定向




它只是一个Web服务项目,除了ASMX页面和相关的

stuff之外在那个目录中,web.config中没有任何内容关于

重定向到登录页面等等。


昨晚我们确实发现了捕获错误的'

的Web应用程序被设置为主站点。对于整个服务器,其中
与dev / test / train / prod中的其他服务器不同。一套

服务器,我们正在调查那是否是问题。


谢谢 -


--woody


" Kevin Yu [MSFT]"写道:
That''s exactly it. Nice succinct summary :).

I''ll check the configuration and let you know. I''m pretty sure it''s set to
get content from the directory the asmx pages are in, and not to redirect
anywhere else.

It''s just a web service project, nothing but ASMX pages and associated
"stuff" in that directory, there''s nothing in the web.config about
redirecting to a login page, etc.

We did discover last night that apparently the web application that''s
catching the error is set up as the "home site" for the entire server, which
is different than the other servers in the "dev/test/train/prod" set of
servers, we''re investigating that to see if that''s the problem.

Thanks -

--woody

"Kevin Yu [MSFT]" wrote:
嗨伍迪,

首先,我想确认一下我对你的问题的理解。从您的描述中,我了解到在某个服务器上,您的Web服务被重定向到另一个页面。如果有任何误解,请随时告诉我。

由于此问题只发生在您的生产服务器上,我认为这可能是一个配置错误IIS。请打开机器上的IIS配置,右键单击Web服务,然后单击目录选项卡。在顶部,当连接到此资源时,内容
应该来自选项必须设置为指定目录。它可能已被设置为重定向到URL。发生重定向。

如果不是这样,您能否向我提供有关您的网络服务的更多信息?它是一个web服务项目还是ASP.NET项目中的一些asmx页面?如果是这样,表单身份验证ASP.NET应用程序也可能导致此重定向。

HTH。

Kevin Yu
====== =
此帖子是按原样提供的没有保证,也没有授予
权利。
Hi Woody,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that on a certain server, your webservice is
redirected to another page. If there is any misunderstanding, please feel
free to let me know.

Since this issue only happens on your production server, I assume this
might be a configuration error on the IIS. Please open the IIS
configuration on the machine, right click on the webservice and click the
Directory tab. on the top, "When connecting to this resource, the content
should com from" option has to be set to "The designated directory". It
might have been set to "A redirection to a URL" and the redirection occurs.

If that is not the case, could you provide me with more information about
your web service? Is it a webservice project or some asmx pages in an
ASP.NET project? If so, a forms authentication ASP.NET app might also cause
this redirection.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



只是为了确认 - 我检查了属性和webservices文件夹是不是

设置为重定向到正在捕获错误的文件夹。


基本网站设置为重定向到''的文件夹捕获错误

- 它看起来有点类似于该文件夹中的web.config文件正在应用于Web服务文件夹的
。但只是部分?


这一切都非常奇怪且难以解释。


我的管理员更改了web.config web服务文件夹将

customErrors模式设置为Off。我们还更改了SSL设置,以便Web服务不需要SSL。


然后我们输入ASMX文件的地址。 />

我们收到一条完整的错误消息,抱怨web.config文件中的

OTHER网站无法在此目录中应用,因为并非所有必需的

文件可用。


所以至少Web服务web.config文件的某些部分是适用的,

但它'还在尝试使用一个HTTP处理程序,它只能用于

网站的web.config文件。


Gah - 我我要把我的弹珠带回家。


- woody


Kevin Yu [MSFT]"写道:
Just to confirm - I checked the properties and the webservices folder is not
set to redirect to the folder that''s catching the errors.

The base website IS set to redirect to the folder that''s catching the errors
- and it looks sorta like the web.config file from that folder is being
applied to the web services folder. but only partially?

It''s all very strange and hard to explain.

I had my admin change the web.config in the web services folder to set the
customErrors mode to Off. We also changed the SSL settings so that SSL is not
required for the web service.

Then we typed in the address to the ASMX file.

We got a full error message complaining that the web.config file fom the
OTHER site couldn''t be applied in this directory, as not all the required
files are available.

So atleast some parts of the web services web.config file are applicable,
but it''s still trying to use an HTTP handler that''s only available for the
web site''s web.config file.

Gah - I''m gonna take my marbles and go home.

--woody

"Kevin Yu [MSFT]" wrote:
嗨伍迪,

首先,我想确认一下我对你的问题的理解。从您的描述中,我了解到在某个服务器上,您的Web服务被重定向到另一个页面。如果有任何误解,请随时告诉我。

由于此问题只发生在您的生产服务器上,我认为这可能是一个配置错误IIS。请打开机器上的IIS配置,右键单击Web服务,然后单击目录选项卡。在顶部,当连接到此资源时,内容
应该来自选项必须设置为指定目录。它可能已被设置为重定向到URL。发生重定向。

如果不是这样,您能否向我提供有关您的网络服务的更多信息?它是一个web服务项目还是ASP.NET项目中的一些asmx页面?如果是这样,表单身份验证ASP.NET应用程序也可能导致此重定向。

HTH。

Kevin Yu
====== =
此帖子是按原样提供的没有保证,也没有赋予
权利。
Hi Woody,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that on a certain server, your webservice is
redirected to another page. If there is any misunderstanding, please feel
free to let me know.

Since this issue only happens on your production server, I assume this
might be a configuration error on the IIS. Please open the IIS
configuration on the machine, right click on the webservice and click the
Directory tab. on the top, "When connecting to this resource, the content
should com from" option has to be set to "The designated directory". It
might have been set to "A redirection to a URL" and the redirection occurs.

If that is not the case, could you provide me with more information about
your web service? Is it a webservice project or some asmx pages in an
ASP.NET project? If so, a forms authentication ASP.NET app might also cause
this redirection.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."



这篇关于C#网络服务/网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆