By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,016 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,016 IT Pros & Developers. It's quick & easy.

WCF webservice over SSL and without

P: n/a
Hi,

I'd like to my WCF webservice to work both on SSL and without. Unfortunately searching has
led to dead ends, references to changes that only work on the old previous beta versions and
I admit I am rather confused and frustrated.

That being said, I'd like some direction in how exactly I'm supposed to accomplish this.

Thanks very much,
JK
Apr 4 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Steven and Tiago,

Sorry for the late response, I've been away for a bit and this got put on the backburner.

Thanks to both of you, I've managed to get https working (almost). I think perhaps I'm still
doing something wrong?

After adding httpsGetEnabled="true, it works beautifully, however, it spits out
https://machinename/filename.svc?wsdl which won't work from the public internet.

So to change this, among the other things I've attempted, I tried using httpsGetUrl and was
presented with this:
A registration already exists for URI 'https://machinename/file.svc'.

I've tried other things (baseAddress, etc.) and none of it seems to change it...

Thanks,
JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:if**************@TK2MSFTNGHUB02.phx.gbl...
Hi Jonathan,

Have you got any progress on this or does the suggestion in my last reply
help some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 4 Apr 2008 12:58:48 -0400
Thank you Steven. Yes I am going to use the IIS method and I do have it
already setup for
that. I'm also familiar with how to setup a secure site in IIS.
Additionally, I've also
configured the older ASMX webservices over https via IIS before.

However, with this WCF webservice, if I hit the .svc file via IE using the
https://server/service.svc link it spits back a http link reference to the
WSDL.
Even if I rewrite the URL as https://server/services.svc?WSDL, it just
sends me to the
initial page with the http wsdl link.

Surely that can't be right?

I'm assuming there's some point of endpoint configuration I need to do.
That's the part I'm
missing/confused about.
-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:2S**************@TK2MSFTNGHUB02.phx.gbl...
>Hi Jonathan,

From your description, you're going to expose your WCF service via both
SSL
>and non-SSL channel, correct?

Are you going to use SSL over Http(the most common and convenient
approach)? For non-SSL, I think it is quite straightforward, and what you
need to do is adding a new service endponit that use https/ssl based
address. If hosting in IIS is possible, I recommend you host the
https/ssl
>one in IIS since that can make the SSL/HTTPS configuration much more
convenient. Here are some reference about configuring SSL/HTTPS in IIS:

#On IIS 6.0, how do I configure my website to use SSL?
http://www.petri.co.il/configure_ssl...e_with_iis.htm

#Configuring SSL on a Web Server or Web Site (IIS 6.0)
http://www.microsoft.com/technet/pro.../Library/IIS/5
>6bdf977-14f8-4867-9c51-34c346d48b04.mspx?mfr=true

Sure, https/ssl can be used out of IIS based on the new http.sys component
in windows and WCF can also uitlize it. However, it will require much more
configuration which is complex. Here are some reference mentioned about
configurating HTTPS in self-hosted context:

#Configuring HTTP and HTTPS
http://msdn2.microsoft.com/en-us/library/ms733768.aspx

#WCF example: Using of self-hosted service with SSL
http://developers.de/blogs/damir_dob...08/01/897.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
Subject: WCF webservice over SSL and without
Date: Thu, 3 Apr 2008 23:12:13 -0400
Hi,

I'd like to my WCF webservice to work both on SSL and without.
Unfortunately searching has
led to dead ends, references to changes that only work on the old previous
beta versions and
I admit I am rather confused and frustrated.

That being said, I'd like some direction in how exactly I'm supposed to
accomplish this.

Thanks very much,
JK

Jun 27 '08 #2

P: n/a
Thanks for your followup JK,

So the problem seems due to the the public internet can not directly get
into your server machien via the servername. is there a public accessible
DNS address for the server so that external network can visit it?

Based on my research, for IIS hosted WCF environment, it will be hard to
customize the metadata exchange endpoints. I think you can consider the
following mean to expose the WCF service's metadata:

1. You can host the same service on another public accessible server and it
is only used to expose the metadata for the client to download. also, for
that service, you do not need to use HTTPS/SSL

2. WCF provide a svcutil.exe that can help download the metadata of a
service to local files. You can use it to download the metadata to local
files and republish them via a public accessible server. BTW, you need to
open the wsdl document and change some urls in it since the default values
are still pointing to the original server address(the machinename for your
case):

#ServiceModel Metadata Utility Tool (Svcutil.exe)
http://msdn2.microsoft.com/en-us/library/aa347733.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Thu, 24 Apr 2008 20:39:14 -0400
Hi Steven and Tiago,

Sorry for the late response, I've been away for a bit and this got put on
the backburner.

Thanks to both of you, I've managed to get https working (almost). I think
perhaps I'm still
doing something wrong?

After adding httpsGetEnabled="true, it works beautifully, however, it spits
out
https://machinename/filename.svc?wsdl which won't work from the public
internet.

So to change this, among the other things I've attempted, I tried using
httpsGetUrl and was
presented with this:
A registration already exists for URI 'https://machinename/file.svc'.

I've tried other things (baseAddress, etc.) and none of it seems to change
it...

Thanks,
JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:if**************@TK2MSFTNGHUB02.phx.gbl...
Hi Jonathan,

Have you got any progress on this or does the suggestion in my last reply
help some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

This posting is provided "AS IS" with no warranties, and confers no
rights.
>
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 4 Apr 2008 12:58:48 -0400
Thank you Steven. Yes I am going to use the IIS method and I do have it
already setup for
that. I'm also familiar with how to setup a secure site in IIS.
Additionally, I've also
configured the older ASMX webservices over https via IIS before.

However, with this WCF webservice, if I hit the .svc file via IE using the
https://server/service.svc link it spits back a http link reference to the
WSDL.
Even if I rewrite the URL as https://server/services.svc?WSDL, it just
sends me to the
initial page with the http wsdl link.

Surely that can't be right?

I'm assuming there's some point of endpoint configuration I need to do.
That's the part I'm
missing/confused about.
-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:2S**************@TK2MSFTNGHUB02.phx.gbl...
>Hi Jonathan,

From your description, you're going to expose your WCF service via both
SSL
>and non-SSL channel, correct?

Are you going to use SSL over Http(the most common and convenient
approach)? For non-SSL, I think it is quite straightforward, and what you
need to do is adding a new service endponit that use https/ssl based
address. If hosting in IIS is possible, I recommend you host the
https/ssl
>one in IIS since that can make the SSL/HTTPS configuration much more
convenient. Here are some reference about configuring SSL/HTTPS in IIS:

#On IIS 6.0, how do I configure my website to use SSL?
http://www.petri.co.il/configure_ssl...e_with_iis.htm

#Configuring SSL on a Web Server or Web Site (IIS 6.0)
http://www.microsoft.com/technet/pro.../Library/IIS/5
>6bdf977-14f8-4867-9c51-34c346d48b04.mspx?mfr=true

Sure, https/ssl can be used out of IIS based on the new http.sys
component
>in windows and WCF can also uitlize it. However, it will require much
more
>configuration which is complex. Here are some reference mentioned about
configurating HTTPS in self-hosted context:

#Configuring HTTP and HTTPS
http://msdn2.microsoft.com/en-us/library/ms733768.aspx

#WCF example: Using of self-hosted service with SSL
http://developers.de/blogs/damir_dob...08/01/897.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
>up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================= =
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
Subject: WCF webservice over SSL and without
Date: Thu, 3 Apr 2008 23:12:13 -0400
Hi,

I'd like to my WCF webservice to work both on SSL and without.
Unfortunately searching has
led to dead ends, references to changes that only work on the old
previous
>beta versions and
I admit I am rather confused and frustrated.

That being said, I'd like some direction in how exactly I'm supposed to
accomplish this.

Thanks very much,
JK


Jun 27 '08 #3

P: n/a
Thanks, but I know how to do all that. Http works fine (because I set a host header with the
correct public host name), this is just https that's the problem...

I simply want to customize the machinename in https://machinename/file.svc?wsdl output on
https when going to the service.

-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:5Q**************@TK2MSFTNGHUB02.phx.gbl...
Thanks for your followup JK,

So the problem seems due to the the public internet can not directly get
into your server machien via the servername. is there a public accessible
DNS address for the server so that external network can visit it?

Based on my research, for IIS hosted WCF environment, it will be hard to
customize the metadata exchange endpoints. I think you can consider the
following mean to expose the WCF service's metadata:

1. You can host the same service on another public accessible server and it
is only used to expose the metadata for the client to download. also, for
that service, you do not need to use HTTPS/SSL

2. WCF provide a svcutil.exe that can help download the metadata of a
service to local files. You can use it to download the metadata to local
files and republish them via a public accessible server. BTW, you need to
open the wsdl document and change some urls in it since the default values
are still pointing to the original server address(the machinename for your
case):

#ServiceModel Metadata Utility Tool (Svcutil.exe)
http://msdn2.microsoft.com/en-us/library/aa347733.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Thu, 24 Apr 2008 20:39:14 -0400
Hi Steven and Tiago,

Sorry for the late response, I've been away for a bit and this got put on
the backburner.

Thanks to both of you, I've managed to get https working (almost). I think
perhaps I'm still
doing something wrong?

After adding httpsGetEnabled="true, it works beautifully, however, it spits
out
https://machinename/filename.svc?wsdl which won't work from the public
internet.

So to change this, among the other things I've attempted, I tried using
httpsGetUrl and was
presented with this:
A registration already exists for URI 'https://machinename/file.svc'.

I've tried other things (baseAddress, etc.) and none of it seems to change
it...

Thanks,
JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:if**************@TK2MSFTNGHUB02.phx.gbl...
>Hi Jonathan,

Have you got any progress on this or does the suggestion in my last reply
help some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

This posting is provided "AS IS" with no warranties, and confers no
rights.
>>
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 4 Apr 2008 12:58:48 -0400
Thank you Steven. Yes I am going to use the IIS method and I do have it
already setup for
that. I'm also familiar with how to setup a secure site in IIS.
Additionally, I've also
configured the older ASMX webservices over https via IIS before.

However, with this WCF webservice, if I hit the .svc file via IE using the
https://server/service.svc link it spits back a http link reference to the
WSDL.
Even if I rewrite the URL as https://server/services.svc?WSDL, it just
sends me to the
initial page with the http wsdl link.

Surely that can't be right?

I'm assuming there's some point of endpoint configuration I need to do.
That's the part I'm
missing/confused about.
-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:2S**************@TK2MSFTNGHUB02.phx.gbl...
>>Hi Jonathan,

From your description, you're going to expose your WCF service via both
SSL
>>and non-SSL channel, correct?

Are you going to use SSL over Http(the most common and convenient
approach)? For non-SSL, I think it is quite straightforward, and what you
need to do is adding a new service endponit that use https/ssl based
address. If hosting in IIS is possible, I recommend you host the
https/ssl
>>one in IIS since that can make the SSL/HTTPS configuration much more
convenient. Here are some reference about configuring SSL/HTTPS in IIS:

#On IIS 6.0, how do I configure my website to use SSL?
http://www.petri.co.il/configure_ssl...e_with_iis.htm

#Configuring SSL on a Web Server or Web Site (IIS 6.0)
http://www.microsoft.com/technet/pro.../Library/IIS/5
>>6bdf977-14f8-4867-9c51-34c346d48b04.mspx?mfr=true

Sure, https/ssl can be used out of IIS based on the new http.sys
component
>>in windows and WCF can also uitlize it. However, it will require much
more
>>configuration which is complex. Here are some reference mentioned about
configurating HTTPS in self-hosted context:

#Configuring HTTP and HTTPS
http://msdn2.microsoft.com/en-us/library/ms733768.aspx

#WCF example: Using of self-hosted service with SSL
http://developers.de/blogs/damir_dob...08/01/897.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================ ==
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>>where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
>>up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================ ==
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>>

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
Subject: WCF webservice over SSL and without
Date: Thu, 3 Apr 2008 23:12:13 -0400
Hi,

I'd like to my WCF webservice to work both on SSL and without.
Unfortunately searching has
led to dead ends, references to changes that only work on the old
previous
>>beta versions and
I admit I am rather confused and frustrated.

That being said, I'd like some direction in how exactly I'm supposed to
accomplish this.

Thanks very much,
JK


Jun 27 '08 #4

P: n/a
Thanks for your reply Jonathan,

I'll perform some further research to see whether there is still any other
means helpful. I'll update you if I get any new results.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
<#c**************@TK2MSFTNGP05.phx.gbl>
<5Q**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 25 Apr 2008 12:08:53 -0400
Thanks, but I know how to do all that. Http works fine (because I set a
host header with the
correct public host name), this is just https that's the problem...

I simply want to customize the machinename in
https://machinename/file.svc?wsdl output on
https when going to the service.

-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:5Q**************@TK2MSFTNGHUB02.phx.gbl...
Thanks for your followup JK,

So the problem seems due to the the public internet can not directly get
into your server machien via the servername. is there a public accessible
DNS address for the server so that external network can visit it?

Based on my research, for IIS hosted WCF environment, it will be hard to
customize the metadata exchange endpoints. I think you can consider the
following mean to expose the WCF service's metadata:

1. You can host the same service on another public accessible server and
it
is only used to expose the metadata for the client to download. also, for
that service, you do not need to use HTTPS/SSL

2. WCF provide a svcutil.exe that can help download the metadata of a
service to local files. You can use it to download the metadata to local
files and republish them via a public accessible server. BTW, you need to
open the wsdl document and change some urls in it since the default values
are still pointing to the original server address(the machinename for your
case):

#ServiceModel Metadata Utility Tool (Svcutil.exe)
http://msdn2.microsoft.com/en-us/library/aa347733.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Thu, 24 Apr 2008 20:39:14 -0400
Hi Steven and Tiago,

Sorry for the late response, I've been away for a bit and this got put on
the backburner.

Thanks to both of you, I've managed to get https working (almost). I
think
perhaps I'm still
doing something wrong?

After adding httpsGetEnabled="true, it works beautifully, however, it
spits
out
https://machinename/filename.svc?wsdl which won't work from the public
internet.

So to change this, among the other things I've attempted, I tried using
httpsGetUrl and was
presented with this:
A registration already exists for URI 'https://machinename/file.svc'.

I've tried other things (baseAddress, etc.) and none of it seems to change
it...

Thanks,
JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:if**************@TK2MSFTNGHUB02.phx.gbl...
>Hi Jonathan,

Have you got any progress on this or does the suggestion in my last reply
help some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

This posting is provided "AS IS" with no warranties, and confers no
rights.
>>
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 4 Apr 2008 12:58:48 -0400
Thank you Steven. Yes I am going to use the IIS method and I do have it
already setup for
that. I'm also familiar with how to setup a secure site in IIS.
Additionally, I've also
configured the older ASMX webservices over https via IIS before.

However, with this WCF webservice, if I hit the .svc file via IE using
the
>https://server/service.svc link it spits back a http link reference to
the
>WSDL.
Even if I rewrite the URL as https://server/services.svc?WSDL, it just
sends me to the
initial page with the http wsdl link.

Surely that can't be right?

I'm assuming there's some point of endpoint configuration I need to do.
That's the part I'm
missing/confused about.
-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:2S**************@TK2MSFTNGHUB02.phx.gbl...
>>Hi Jonathan,

From your description, you're going to expose your WCF service via both
SSL
>>and non-SSL channel, correct?

Are you going to use SSL over Http(the most common and convenient
approach)? For non-SSL, I think it is quite straightforward, and what
you
>>need to do is adding a new service endponit that use https/ssl based
address. If hosting in IIS is possible, I recommend you host the
https/ssl
>>one in IIS since that can make the SSL/HTTPS configuration much more
convenient. Here are some reference about configuring SSL/HTTPS in IIS:

#On IIS 6.0, how do I configure my website to use SSL?
http://www.petri.co.il/configure_ssl...e_with_iis.htm

#Configuring SSL on a Web Server or Web Site (IIS 6.0)
http://www.microsoft.com/technet/pro.../Library/IIS/5
>>6bdf977-14f8-4867-9c51-34c346d48b04.mspx?mfr=true

Sure, https/ssl can be used out of IIS based on the new http.sys
component
>>in windows and WCF can also uitlize it. However, it will require much
more
>>configuration which is complex. Here are some reference mentioned about
configurating HTTPS in self-hosted context:

#Configuring HTTP and HTTPS
http://msdn2.microsoft.com/en-us/library/ms733768.aspx

#WCF example: Using of self-hosted service with SSL
http://developers.de/blogs/damir_dob...08/01/897.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>>suggestions about how we can improve the support we provide to you.
Please
>>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================ ==
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>>where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
>>up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach
the
>>most efficient resolution. The offering is not appropriate for
situations
>>that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are
best
>>handled working with a dedicated Microsoft Support Engineer by
contacting
>>Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================ ==
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>>

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
Subject: WCF webservice over SSL and without
Date: Thu, 3 Apr 2008 23:12:13 -0400
Hi,

I'd like to my WCF webservice to work both on SSL and without.
Unfortunately searching has
led to dead ends, references to changes that only work on the old
previous
>>beta versions and
I admit I am rather confused and frustrated.

That being said, I'd like some direction in how exactly I'm supposed to
accomplish this.

Thanks very much,
JK



Jun 27 '08 #5

P: n/a
Hi Jonathan,

Here are some further information I've got. The url address display on the
service description does be changable. We can change it by customizing the
servicehost's base address. For IIS hosted scenario, we need to register a
ServiceHostFactory for the service like below:

=======apply the service factory type in @ServiceHost
directive================
<%@ ServiceHost Language="C#" Debug="true" Service="Service"
Factory="WCFExtensionLib.MyServiceHostFactory"
CodeBehind="~/App_Code/Service.cs" %>

===========create the custom servicehost factory class===============

namespace WCFExtensionLib
{
public class MyServiceHostFactory :ServiceHostFactory
{
protected override System.ServiceModel.ServiceHost
CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{

Uri[] addrs = new Uri[2];
addrs[0] = new Uri("http://138129m/WCFSVC/service.svc");
addrs[1] = new Uri("https://138129m/WCFSVC/service.svc");

return base.CreateServiceHost(serviceType, addrs);
}
}
}
=======================

BTW, the address you supplied should match the service.svc(svc file)'s
real virtual path so that the client consumer can reach the svc file via
that path, otherwise, it will not work.

Hope this also helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
X-Tomcat-ID: 90102308
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
<#c**************@TK2MSFTNGP05.phx.gbl>
<5Q**************@TK2MSFTNGHUB02.phx.gbl>
<eu**************@TK2MSFTNGP02.phx.gbl>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_B95C5D5C"
Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng [MSFT])
Organization: Microsoft
Date: Mon, 28 Apr 2008 10:15:32 GMT
Subject: Re: WCF webservice over SSL and without
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <NU**************@TK2MSFTNGHUB02.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 633
Path: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.webservices:3487
NNTP-Posting-Host: TOMCATIMPORT3 10.201.220.210

Thanks for your reply Jonathan,

I'll perform some further research to see whether there is still any other
means helpful. I'll update you if I get any new results.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
<#c**************@TK2MSFTNGP05.phx.gbl>
<5Q**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 25 Apr 2008 12:08:53 -0400
Thanks, but I know how to do all that. Http works fine (because I set a
host header with the
correct public host name), this is just https that's the problem...

I simply want to customize the machinename in
https://machinename/file.svc?wsdl output on
https when going to the service.

-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:5Q**************@TK2MSFTNGHUB02.phx.gbl...
Thanks for your followup JK,

So the problem seems due to the the public internet can not directly get
into your server machien via the servername. is there a public accessible
DNS address for the server so that external network can visit it?

Based on my research, for IIS hosted WCF environment, it will be hard to
customize the metadata exchange endpoints. I think you can consider the
following mean to expose the WCF service's metadata:

1. You can host the same service on another public accessible server and
it
is only used to expose the metadata for the client to download. also, for
that service, you do not need to use HTTPS/SSL

2. WCF provide a svcutil.exe that can help download the metadata of a
service to local files. You can use it to download the metadata to local
files and republish them via a public accessible server. BTW, you need to
open the wsdl document and change some urls in it since the default values
are still pointing to the original server address(the machinename for your
case):

#ServiceModel Metadata Utility Tool (Svcutil.exe)
http://msdn2.microsoft.com/en-us/library/aa347733.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
<ex**************@TK2MSFTNGP05.phx.gbl>
<if**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Thu, 24 Apr 2008 20:39:14 -0400
Hi Steven and Tiago,

Sorry for the late response, I've been away for a bit and this got put on
the backburner.

Thanks to both of you, I've managed to get https working (almost). I
think
perhaps I'm still
doing something wrong?

After adding httpsGetEnabled="true, it works beautifully, however, it
spits
out
https://machinename/filename.svc?wsdl which won't work from the public
internet.

So to change this, among the other things I've attempted, I tried using
httpsGetUrl and was
presented with this:
A registration already exists for URI 'https://machinename/file.svc'.

I've tried other things (baseAddress, etc.) and none of it seems to change
it...

Thanks,
JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:if**************@TK2MSFTNGHUB02.phx.gbl...
>Hi Jonathan,

Have you got any progress on this or does the suggestion in my last reply
help some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you.
Please
>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================= =
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>ications.

This posting is provided "AS IS" with no warranties, and confers no
rights.
>>
--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
References: <O5**************@TK2MSFTNGP05.phx.gbl>
<2S**************@TK2MSFTNGHUB02.phx.gbl>
Subject: Re: WCF webservice over SSL and without
Date: Fri, 4 Apr 2008 12:58:48 -0400
Thank you Steven. Yes I am going to use the IIS method and I do have it
already setup for
that. I'm also familiar with how to setup a secure site in IIS.
Additionally, I've also
configured the older ASMX webservices over https via IIS before.

However, with this WCF webservice, if I hit the .svc file via IE using
the
>https://server/service.svc link it spits back a http link reference to
the
>WSDL.
Even if I rewrite the URL as https://server/services.svc?WSDL, it just
sends me to the
initial page with the http wsdl link.

Surely that can't be right?

I'm assuming there's some point of endpoint configuration I need to do.
That's the part I'm
missing/confused about.
-JK

"Steven Cheng [MSFT]" <st*****@online.microsoft.comwrote in message
news:2S**************@TK2MSFTNGHUB02.phx.gbl...
>>Hi Jonathan,

From your description, you're going to expose your WCF service via both
SSL
>>and non-SSL channel, correct?

Are you going to use SSL over Http(the most common and convenient
approach)? For non-SSL, I think it is quite straightforward, and what
you
>>need to do is adding a new service endponit that use https/ssl based
address. If hosting in IIS is possible, I recommend you host the
https/ssl
>>one in IIS since that can make the SSL/HTTPS configuration much more
convenient. Here are some reference about configuring SSL/HTTPS in IIS:

#On IIS 6.0, how do I configure my website to use SSL?
http://www.petri.co.il/configure_ssl...e_with_iis.htm

#Configuring SSL on a Web Server or Web Site (IIS 6.0)
http://www.microsoft.com/technet/pro.../Library/IIS/5
>>6bdf977-14f8-4867-9c51-34c346d48b04.mspx?mfr=true

Sure, https/ssl can be used out of IIS based on the new http.sys
component
>>in windows and WCF can also uitlize it. However, it will require much
more
>>configuration which is complex. Here are some reference mentioned about
configurating HTTPS in self-hosted context:

#Configuring HTTP and HTTPS
http://msdn2.microsoft.com/en-us/library/ms733768.aspx

#WCF example: Using of self-hosted service with SSL
http://developers.de/blogs/damir_dob...08/01/897.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments
and
>>suggestions about how we can improve the support we provide to you.
Please
>>feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

================================================ ==
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
>>ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
>>where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
>>up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach
the
>>most efficient resolution. The offering is not appropriate for
situations
>>that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are
best
>>handled working with a dedicated Microsoft Support Engineer by
contacting
>>Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
================================================ ==
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>>

--------------------
Reply-To: "Jonathan Kay" <jo*********@newsgroup.nospam>
From: "Jonathan Kay" <jo*********@newsgroup.nospam>
Subject: WCF webservice over SSL and without
Date: Thu, 3 Apr 2008 23:12:13 -0400
Hi,

I'd like to my WCF webservice to work both on SSL and without.
Unfortunately searching has
led to dead ends, references to changes that only work on the old
previous
>>beta versions and
I admit I am rather confused and frustrated.

That being said, I'd like some direction in how exactly I'm supposed to
accomplish this.

Thanks very much,
JK



Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.