Quote:Failed to load resource: the server responded with a status of 405 (Method Not Allowed) Default.aspx:1 XMLHttpRequest cannot load http://pc174398.cts.com/CTService/WCFTestDemo.Service1.svc/GetData. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:57065' is therefore not allowed access. The response had HTTP status code 405.
Quote:<configuration> <appsettings> <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"> <system.web> <compilation debug="true"> <system.webserver> <modules runallmanagedmodulesforallrequests="true"> <directorybrowse enabled="true"> <!-- When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries. --> <system.servicemodel> <servicehostingenvironment aspnetcompatibilityenabled="false" multiplesitebindingsenabled="true"> <services> <service name="WCFTestDemo.Service1" behaviorconfiguration="ServiceBehavior"> <host> <baseAddresses> <add baseaddress="http://localhost/WCFTestDemo/Service1.svc"> </baseAddresses> <!-- Service Endpoints --> <!-- Unless fully qualified, address is relative to base address supplied above --> <endpoint address="" name="webHttp" binding="webHttpBinding" bindingconfiguration="BindingWeb" contract="WCFTestDemo.IService1" behaviorconfiguration="EndpBehavior"> <!-- Upon deployment, the following identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically. --> <!--<identity> <dns value="localhost"> --> <!-- Metadata Endpoints --> <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> <!-- This endpoint does not use a secure binding and should be secured or removed before deployment --> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"> <behaviors> <servicebehaviors> <behavior name="ServiceBehavior"> <!-- To avoid disclosing metadata information, set the values below to false before deployment --> <servicemetadata httpgetenabled="True" httpgeturl="true" httpsgetenabled="false"> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <servicedebug includeexceptiondetailinfaults="true"> <endpointbehaviors> <behavior name="EndpBehavior"> <webhttp helpenabled="true"> <enablewebscript> <bindings> <webhttpbinding> <binding name="BindingWeb" crossdomainscriptaccessenabled="true"> <security mode="None"> <transport clientcredentialtype="None"> <!--<message establishsecuritycontext="false">--> <!--<protocolmapping> <add binding="webHttpBinding" bindingconfiguration="BindingWeb" scheme="http"> -->
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)