मैं एक WCF सेवा है जो काम करता है इंटरनेट एक्सप्लोरर में होने की उम्मीद के रूप में एक डेटाबेस के लिए एक ग्राहक और लेकिन नहीं क्रोम में बचाता है (कि कारण के लिए मैं HTML/Json को अलग कर देंगे क्योंकि यह मुझे लगता है कि यह एक वेब कॉन्फ़िगरेशन मुद्दा है लेकिन अगर कोई मुझे पसंद करता है तो मैं पोस्ट कर सकता हूं)।अमान्य HTTP स्थिति कोड 405 केवल
संसाधन लोड करने में असफल:
क्रोम में मैं त्रुटि मिलती है सर्वर 405 की स्थिति के साथ प्रतिक्रिया व्यक्त (पद्धति की अनुमति नहीं) Subscriber.htm: 1 XMLHttpRequest http://example.com/MyService.svc/SaveCustomer लोड नहीं कर सकता। अमान्य HTTP स्थिति कोड 405
मेरा वेब कॉन्फ़िग:
<system.web>
<compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
<pages>
<namespaces>
<add namespace="System.Runtime.Serialization" />
<add namespace="System.ServiceModel" />
<add namespace="System.ServiceModel.Web" />
</namespaces>
</pages>
</system.web>
<system.serviceModel>
<services>
<service name="IService.MyService">
<endpoint address="http://example.com/MyService.svc"
binding="webHttpBinding"
bindingConfiguration=""
contract="IService"
behaviorConfiguration="webHttpBinding" />
</service>
</services>
<client>
<endpoint
binding="webHttpBinding"
bindingConfiguration=""
address="http://example.com/MyService.svc"
contract="IService" />
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 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="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webHttpBinding">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<httpProtocol>
<customHeaders>
<!-- Enable Cross Domain AJAX calls -->
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type, Authorization, Accept, X-Requested-With" />
<add name="Access-Control-Allow-Methods" value="OPTIONS, TRACE, GET, HEAD, POST, PUT" />
</customHeaders>
</httpProtocol>
</system.webServer>
तो मैं कुछ लेख पढ़ सकते हैं और प्रासंगिक वर्गों कहा, WebDav को हटाने लेकिन कुछ भी एक फर्क करने लगता है।
इस कड़ी में मदद मिल सकती हैं-
http://stackoverflow.com/questions/18825458/post-data-to-restful-invalid-http-status-code-405 –