“The resource you are looking for (or one of its dependencies)” error WCF REST

  • Thread starter Thread starter Thabetidris
  • Start date Start date
T

Thabetidris

Guest
I have a RESTful service that doesn't work, despite I verify all the code: web.config, the Iservic and the implementation: IServiceImport:

namespace SysLap.Services.Web.ImportAutoLiasse
{
[ServiceContract]
public interface IServiceImportAutoLiasse
{
[OperationContract]
[WebGet]
string GetData(int value);
}
}



ServiceImport.svc.cs:


namespace SysLap.Services.Web.ImportAutoLiasse
{
public class IServiceImportAutoLiasse: IServiceImportAutoLiasse
{
public string GetData(int value)
{
return string.Format("You entered: {0}", value);
}
}
}

Web.config:

<services>
<!--SOAP-->
<service behaviorConfiguration="ServBehavior" name="SysLap.Services.Web.ImportAutoLiasse.ServiceImportAutoLiasse">
<endpoint address="soap" binding="basicHttpBinding" bindingConfiguration=""
contract="SysLap.Services.Web.ImportAutoLiasse.IServiceImportAutoLiasse" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
contract="IMetadataExchange" />

<!--REST-->
<endpoint address="rest" behaviorConfiguration="restBehavior"
binding="webHttpBinding" bindingConfiguration="" contract="SysLap.Services.Web.ImportAutoLiasse.IServiceImportAutoLiasse" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp helpEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>

When I test SOAP, it works well, but if I test the wcf REST, I have this error :

HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed,
had its name changed, or is temporarily unavailable. Please review the following URL and make sure
that it is spelled correctly.





How can I fix it ? Thanks,

Continue reading...
 
Back
Top