Answered by:
URGENT>>>>>Consuming REST Services

Question
-
User27651214 posted
Dear All,
i have a REST Service, i need to host those services with only HTTPS protocol enabled. When we have both HTTP and HTTPS i am able consume services using HTTPS protocol. If we disable HTTP on IIS then i tried to consume the services i got error.
Please help.....
Web.Config File:
<system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </modules> </system.webServer> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="0" /> <standardEndpoints> <webHttpEndpoint> <!-- Configure the WCF REST service base address via the global.asax.cs file and the default endpoint via the attributes on the <standardEndpoint> element below --> <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" /> </webHttpEndpoint> </standardEndpoints> </system.serviceModel>
Monday, June 17, 2013 10:26 AM
Answers
-
User260886948 posted
Hi,
Please try to enable the wcf tracing to find the cause.
The following configuration taken from MSDN can be applied to enable tracing on your wcf service.
<configuration> <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" > <listeners> <add name="xml"/> </listeners> </source> <source name="System.ServiceModel.MessageLogging"> <listeners> <add name="xml"/> </listeners> </source> <source name="myUserTraceSource" switchValue="Information, ActivityTracing"> <listeners> <add name="xml"/> </listeners> </source> </sources> <sharedListeners> <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="Error.svclog" /> </sharedListeners> </system.diagnostics> </configuration>
Here are some articles about consuming rest services over https:
http://allen-conway-dotnet.blogspot.com/2012/05/creating-wcf-restful-service-and-secure.html.
http://nirajrules.wordpress.com/2011/04/29/wcf-rest-over-https/ .
Hope it can help you.
Best Regards,
Amy Peng
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, June 20, 2013 2:28 AM
All replies
-
User-1662538993 posted
What error you get when consuming the service?
Monday, June 17, 2013 1:34 PM -
User260886948 posted
Hi,
Please try to enable the wcf tracing to find the cause.
The following configuration taken from MSDN can be applied to enable tracing on your wcf service.
<configuration> <system.diagnostics> <sources> <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" > <listeners> <add name="xml"/> </listeners> </source> <source name="System.ServiceModel.MessageLogging"> <listeners> <add name="xml"/> </listeners> </source> <source name="myUserTraceSource" switchValue="Information, ActivityTracing"> <listeners> <add name="xml"/> </listeners> </source> </sources> <sharedListeners> <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="Error.svclog" /> </sharedListeners> </system.diagnostics> </configuration>
Here are some articles about consuming rest services over https:
http://allen-conway-dotnet.blogspot.com/2012/05/creating-wcf-restful-service-and-secure.html.
http://nirajrules.wordpress.com/2011/04/29/wcf-rest-over-https/ .
Hope it can help you.
Best Regards,
Amy Peng
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, June 20, 2013 2:28 AM