I have a very simple WCF service - it has a single method which returns a bunch of JSON data, and works perfectly through HTTP. When I tried to implement HTTPS, I can browse the WSDL definition but cannot call the method to return the JSON data.
In HTTP I call: http://webservices.tunstall.com/tspservice.svc/getfrontpagedata - all good (when enabled - I only want HTTPS) :)
In HTTPS: https://webservices.tunstall.com/tspservice.svc/getfrontpagedata - I get a "404 - resource cannot be found" error.
This is my first WCF project and very unfamiliar.
Here's my code:
namespace TunstallService
{
[ServiceContract]
public interface ITunstallSharePointService
{
[OperationContract]
[WebGet(UriTemplate = "/GetFrontPageData", RequestFormat = WebMessageFormat.Json,ResponseFormat=WebMessageFormat.Json)]
List<FrontPageData> GetFrontPageData();
}
[DataContract]
public class FrontPageData
{
private string name = String.Empty;
private int _count = 0;
[DataMember]
public string Name
{
get { return name; }
set { name = value; }
}
[DataMember]
public int Count
{
get { return _count; }
set { _count = value; }
}
}
}
Please make sure you have configured HTTPS for the binding and you also need to set "https" in the address of the endpoints.
This article includes a sample of the configure for https.
Hope it helps.
Best Regards.
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
None
0 Points
3 Posts
WCF 4.5 service works through HTTP but not HTTPS
Nov 20, 2012 08:39 AM|TimMorrison|LINK
Hi all,
https://webservices.tunstall.com/tspservice.svc
I have a very simple WCF service - it has a single method which returns a bunch of JSON data, and works perfectly through HTTP. When I tried to implement HTTPS, I can browse the WSDL definition but cannot call the method to return the JSON data.
In HTTP I call: http://webservices.tunstall.com/tspservice.svc/getfrontpagedata - all good (when enabled - I only want HTTPS) :)
In HTTPS: https://webservices.tunstall.com/tspservice.svc/getfrontpagedata - I get a "404 - resource cannot be found" error.
This is my first WCF project and very unfamiliar.
Here's my code:
Any help is greatly appreciated
Contributor
2333 Points
576 Posts
Re: WCF 4.5 service works through HTTP but not HTTPS
Nov 20, 2012 06:02 PM|inquisitive_mind|LINK
Step by Step instructions
http://www.codeproject.com/Articles/36705/7-simple-steps-to-enable-HTTPS-on-WCF-WsHttp-bindi
*** If this post helps you, then Mark this post as Answer ***
None
0 Points
3 Posts
Re: WCF 4.5 service works through HTTP but not HTTPS
Nov 27, 2012 07:24 AM|TimMorrison|LINK
Thanks for that - i have seen this, but, unfortunately that article was written in 2009 and so does not cover dotNet Framework 4.5
Contributor
2716 Points
311 Posts
Re: WCF 4.5 service works through HTTP but not HTTPS
Nov 28, 2012 01:33 AM|Haixia Xie - MSFT|LINK
Hi TimMorrison,
Do you try the version before 4.5( e.g Framework 4.0)?
Best Regards.
None
0 Points
3 Posts
Re: WCF 4.5 service works through HTTP but not HTTPS
Nov 28, 2012 06:42 AM|TimMorrison|LINK
I have just done this - No difference :(
Contributor
2716 Points
311 Posts
Re: WCF 4.5 service works through HTTP but not HTTPS
Nov 29, 2012 03:34 AM|Haixia Xie - MSFT|LINK
Hi,
Please make sure you have configured HTTPS for the binding and you also need to set "https" in the address of the endpoints. This article includes a sample of the configure for https.
Hope it helps.
Best Regards.