with servicio desde consumir consume con ajax wcf sharepoint-2010 https wcf-binding

ajax - servicio - jquery consumir web service soap



cómo configurar HTTPS y enlace HTTP para el servicio web WCF habilitado para Ajax (3)

Encontré un error durante el acceso a mi servicio web en el sitio https. Creo que esto es un error de configuración porque está buscando un enlace https.

aquí está el web.config del servicio web:

<?xml version="1.0"?> <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> <services> <service name="WebService.ListViewWebService" behaviorConfiguration="WebService.ListViewWebServiceBehavior"> <endpoint address="" behaviorConfiguration="WebService.ListViewWebServiceAjaxBehavior" binding="webHttpBinding" contract="WebService.IListViewWebService"/> <endpoint address="https://win-d741qhlbivf:13241/services/DPT/_vti_bin/DPT.WebService/ListViewWebService.svc" behaviorConfiguration="WebService.ListViewWebServiceAjaxBehavior1" binding="webHttpsBinding" contract="WebService.IListViewWebService2"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <bindings> <basicHttpBinding> <binding name="webHttpBinding"> <security mode="None" /> </binding> <binding name="webHttpsBinding"> <security mode="Transport" /> </binding> </basicHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="WebService.ListViewWebServiceAjaxBehavior"> <webHttp/> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="WebService.ListViewWebServiceBehavior"> <serviceDebug includeExceptionDetailInFaults="true"/> <serviceMetadata httpGetEnabled="true" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>

Gracias por la ayuda por adelantado.

Además, no estoy seguro si esto tiene algo que ver con el problema, pero la aplicación web alojada en un entorno de nube ... ¿necesito una configuración especial para eso? ...

gracias de nuevo..



Esta configuración responderá a las solicitudes en HTTP y HTTPS, tenga en cuenta que los puertos son diferentes y tienen que coincidir con lo que espera el host (en este caso, es iis)

<appSettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> </appSettings> <system.web> <compilation debug="true" /> <customErrors mode="Off"/> </system.web> <system.serviceModel> <serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" /> <services> <service name="KPIGetter_Library.KPIGetter"> <endpoint address="" behaviorConfiguration="restfulBehaviour" binding="webHttpBinding" bindingConfiguration="webHttpBindingWithJsonP" contract="KPIGetter_Library.IKpiGetter" /> <endpoint address="" behaviorConfiguration="restfulBehaviour" binding="webHttpBinding" bindingConfiguration="webHttpsBindingWithJsonP" contract="KPIGetter_Library.IKpiGetter" /> <host> <baseAddresses> <add baseAddress="http://hodbd05:8000/kpigetter" /> <add baseAddress="https://hodbd05:8001/kpigetter" /> </baseAddresses> </host> </service> </services> <behaviors> <endpointBehaviors> <behavior name="restfulBehaviour"> <webHttp/> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="webHttpBinding" scheme="http" /> </protocolMapping> <bindings> <webHttpBinding> <binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true"> <security mode="None" /> </binding> <binding name="webHttpsBindingWithJsonP" crossDomainScriptAccessEnabled="true"> <security mode="Transport" /> </binding> </webHttpBinding> </bindings> </system.serviceModel>


Un problema importante es que debe usar webHttpBinding y no el basicHttpBinding para servicios WCF habilitados para jajax.

Un ejemplo de trabajo simple se encuentra aquí: el blog de Scott en asp.net