I am trying to set a web services that return JSON objects and I was following this tutorial but when I go try to run it I get this error
Error: Cannot obtain Metadata from
http://localhost:10995/Service1.svc
If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI:http://localhost:10995/Service1.svc
Metadata contains a reference that cannot be resolved: 'localhost:10995/Service1.svc'. The remote server returned an unexpected response: (405) Method Not Allowed. The remote server returned an error: (405) Method Not Allowed.HTTP GET Error URI:http://localhost:10995/Service1.svc
There was an error downloadinghttp://localhost:10995/Service1.svc
. The request failed with HTTP status 404: Not Found.
So I tried looking up what that means and came across these links to try to fix it
WCF - Error: Cannot obtain Metadata
Error: Cannot obtain Metadata from WCF service
WCF Test Client cannot add service, cannot obtain metadata
but none of them fixed the problem. This is my first attempt at doing any sort of web service stuff and I literally started researching today so obviously I am new to all of this.
what does this error mean and how can I fix it so I can test it out?
<system.serviceModel>
<services>
<service name="WcfService4.Service1" behaviorConfiguration="WcfService4.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="../Service1.svc"
binding="webHttpBinding"
contract="WcfService4.IService1"
behaviorConfiguration="webBehaviour" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfService4.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false 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="webBehaviour">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>