Setting of sharepoint 2010 custom WCF service "web.config" file for both HTTP and HTTPS
-
quinta-feira, 2 de dezembro de 2010 15:29
Hi,
I have created a custom SharePoint 2010 WCF service that is deployed to 14\ISAPI\MYService folder. The issue i am facing is that this service should be accessible from all Web applications, that can be HTTPS (i.e. SSL) enabled or normal HTTP. If i am making in web.config file for web application that has HTTPS enabled, then it fails for Web applications having normal HTTP configuration. My requirement is that when this WCF service is deployed it should accessible from all web applications that can be HTTPS or HTTP both. I went through number of blogs and tried whatever option they had suggested but none of them worked for me :(. Here are some of the blog that i tried:-
- http://forums.silverlight.net/forums/p/13275/44175.aspx
- http://social.msdn.microsoft.com/Forums/en/wcf/thread/871b18b2-53fa-42c4-938e-6a6db9fe3dc5
- http://stackoverflow.com/questions/951204/calling-a-web-service-using-wcf-over-http-and-https
- http://www.vistax64.com/indigo/86653-wcf-endpoints.html
- http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=58989
Please find below the web.config content that i am using :-
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled ="true"/> <bindings> <basicHttpBinding > <binding name="customBasicHttpsBinding"> <security mode="Transport" > <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" /> <message clientCredentialType="Certificate"></message> </security> </binding> </basicHttpBinding> </bindings> <services> <service name ="MYServiceName" behaviorConfiguration="MyServiceTypeBehaviors"> <endpoint address="" binding ="basicHttpBinding" contract ="MYServiceContract"></endpoint> <endpoint address="" binding ="basicHttpBinding" bindingConfiguration ="customBasicHttpsBinding" contract ="MYServiceContract"></endpoint> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MyServiceTypeBehaviors" > <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="true" httpsHelpPageEnabled="true"/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel > </configuration >
Please help me if anybody has the solution for it.Deepak
Deepak Kejriwal
Todas as Respostas
-
sexta-feira, 3 de dezembro de 2010 06:14
Under Services node add below tag and check..
Revert if it works!<endpoint address="" binding="webHttpBinding" contract="MYServiceContract" behaviorConfiguration="web"></endpoint>
Regards,
Venkatesh R
/* My Code Runs in Visual Studio 2010 */
http://geekswithblogs.net/venkatx5/- Editado Venkatx2 sexta-feira, 3 de dezembro de 2010 06:15 Code Updation
- Marcado como Resposta Stanfford Liu quinta-feira, 9 de dezembro de 2010 07:22
- Não Marcado como Resposta Deepak Kejriwal quinta-feira, 9 de dezembro de 2010 09:36
-
quinta-feira, 9 de dezembro de 2010 09:39
Hi Venkatesh,
Thanks for reply but the solution suggested by you doen't work.
Deepak Kejriwal

