C# web service/website ?

G

Guest

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.
 
K

Kevin Yu [MSFT]

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."
 
G

Guest

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
 
G

Guest

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
 
K

Kevin Yu [MSFT]

Hi Woody,

Good to know that you have got the detailed error message. It seems that
the web.config file is corrupt in the WebService directory. We can try to
create a new web.config file and copy it to the directory to see if it
works.

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

Guest

Hm. That's worth a shot but I don't think that's it.

It's certainly a simple and easy thing to try that I haven't tried yet, and
I will cuz it's worth trying :).

Just for grins -

here's how things are arranged:

root web/web site (requires SSL)
root web/web service

The "root web" is set to redirect to "web site", so if you type in
"www.site.com" you really get "www.site.com/web site/login.aspx".

When you attempt to execute
//www.whateveritis.com/webservice/webservice.asmx rather than getting the web
service interface documentation you actually get an error that indicates that
IIS/ASP.NET thinks things are organized:

web site/web service

because it's combining web site/web config with web service/web.config.

The error actually refers to the web site web.config as being in error.

ALL of our various development and test servers have exactly the same
configuration and the only one that acts like this is the production one. I
know(!) this is something stupid and obvious, but I'm so close to it at this
point I can't SEE it. Or I'm not enough of an IIS/Win2k3 admin to recognize
it.

Anyway - For whatever all this is worth - thanks for all your help!

--woody
 
K

Kevin Yu [MSFT]

Hi Woody,

I'm a little confused. the web.config file should only apply to a single
application. But how did IIS mix them together? :-S

As you can see, this is more likely an IIS configuration issue. So besides
posting here, you can also post in the following newsgroup. I think there
will be more professionals who can help you on it. HTH.

microsoft.public.inetserver.iis

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

Roni

Hi,

could you tell me please if both webs helds by the same Application
Pool? I had once a similar problem, and after i changed the application
pool, created for the web one and another one for the webservice, it was
working perfect.

By the way, check your policies.

in my point of view it seems really to be a conifiguration problem and
nothing else.

kind regards,
Roni
 
G

Guest

I'll haveta check the App Pool settings - I didn't configure this originally
so I don't know.

I agree it's a probably either config. problem (as in misconfigured or a
broken configuration), I just don't know what it is and I can't find any
differences between this server and the other similarly configured servers
that ARE working. Especially since this one did work and then stopped.

Lovely fun! :)
 
R

Roni Schuetz

hi

change the extension from web.config to web.xml and then try to open it
in internet explorer.

does it appears well?

best regards
 
R

Roni Schuetz

:-(


now i'm out of idea . . . .

have you tried to get answers in IIS newsgroups? Maybe people there have
better idea's.

Good luck
roni
 
G

Guest

Yup - so far it's just a request for info - I'm not at work today but I
emailed my cohorts so hopefully I'll have an answer for them.

-w
 
R

Roni Schuetz

hi,

wish you good luck with it and keep us up-to-date with it. Im intersted
in to know whats the probleme.

best regards,
roni
 
G

Guest

I got an IM from work that they'd fixed it.

Apparently the redirect decided to start messing things up.

I should point out that this has been set up for atleast 6 months, probably
more.

Why now? who knows, probably something changed deep in the network and it
just twitched enough to mess this up.

I love Windows and the Internet :).

-w
 
K

Kevin Yu [MSFT]

Hi Woody,

Nice to hear that you have had the problem resolved.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top