473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Is there a way to force web service request to use HTTPS.

16
I have an asp.net web service which has SSL enabled via IIS. It works fine if the user uses https, however I have a user that insists on using http on the url.
What I'd like to do is have the web service (asmx) do the equivalent of the response.redirect to change http to https automatically.
I don't believe that I can do this from a web service so does anyone know a of a similar solution for web services.
Jun 1 '10 #1
4 5531
Frinavale
9,735 Expert Mod 8TB
I just did this yesterday :)

I'm using Server 2008 as my operating system. To get around this problem I added a new Website and bound it to port 80 (http). This website has absolutely no content...in IIS I configured it to redirect all requests coming into it to the https:// url. The https website does not have any bindings to port 80...it is only bound to the SSL port (443)

I did a lot of reading online and found a whole bunch of hacks to get around this issue...I think that this solution was the smoothest, easiest to understand that doesn't require any coding at all!

-Frinny
Jun 1 '10 #2
AndrewK
16
@Frinavale
Thanks very much for your answer Frinny, it's much appreciated. However, I'm not sure that it's going to be applicable to me. I've only got one IP address to play with so creating two web sites may not be possible. Also I'm using IIS 6 and I'm not sure whether you can do web site redirections from IIS 6 (unless you know otherwise).
Jun 1 '10 #3
Frinavale
9,735 Expert Mod 8TB
It is possible to have more than one website on the same IP. I do it all the time...each website is bound to a domain and/or port that it responds to.

So you can have 2 websites: one is bound to port 443 and the other is bound to port 80. Both are on the same computer (same IP). Both are going to listen for and respond to requests made on different ports.

I simply made the website bound to port 80 redirect all requests to the other website (bound to port 443).

IIS6 I'm not so familiar with though.
So I looked it up.
Here is an article explaining how to configure IIS6 to host multiple websites: Hosting Multiple Websites in IIS6.

The article you'll be interested in reading is the one about Creating Multiple Sites Using Ports (IIS 6.0)

After you've created the second website (for port 80) you redirect all incoming requests to the "real" website (on port 443...SSL). See this article for information on how to do that: Redirecting Web Sites in IIS 6.0.

-Frinny
Jun 1 '10 #4
AndrewK
16
@Frinavale
Thanks Frinny. That's very helpful. I'll give it a go.
Jun 1 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: CG | last post by:
I have a VS .NET 2003 web service project which references a Managed C++ assembly. The managed C++ assembly in turn uses some unmanaged code. Because of some restriction in the unmanaged...
0
by: Stu | last post by:
Hi, I am calling a web service from a web page. If the web service has not been used for a while it occsionally times out with this error 'System.Net.WebException: The operation has timed-out.'....
0
by: Andrew | last post by:
Hi, I have a web service that I access through ASP.NET with both applications sitting on the same machine. Whilst navigating to the web site using Secure HTTP (HTTPS) I receive an error in...
0
by: Verticon:: | last post by:
Per microsoft, the ExitCode property of the ServiceBase returns 0 for success and non zero for failure. However, when I set this property to 1, the service still stops in a success state. ...
2
by: Joe | last post by:
Hello All: Does IIS thread each web service request? In other words, if I request a web service five times, will IIS thread each request or will it cache requests 2-5 until request 1 has...
0
by: Sanjaya | last post by:
Hi, I need to add application specific headers and reference parameter in the "ReplyTo" to my web service request as header elements. What is right way to do this? I'm using framework 1.1 with...
3
by: curt.ziegler | last post by:
I know this can be done in IIS, and it may even be the preferred method but can someone help me redirect every http request to https? I think it could be done in the global.asax.cs or web.config...
1
by: Gramps | last post by:
Hi, I've generated a client proxy and web service stub using WSDL.exe. All appears ok. The client proxy .cs is in the client app running in VS2005 and the web service stub is running in...
0
by: jacorona | last post by:
Hello all, I have found a problem accesing a web service hosted in IIS 5.0 in a W2K box. The web service site is configured to accept both integrated windows authentication and client certificates....
1
by: vaibhavchavan | last post by:
Hi I am doing application for signing of soap message with digital certificate . I am using WSE 2.0 I worte the the simple webservice & deployed it on in our server machine . To make it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.