I tried to make REST / SOAP endpoints for a WCF service, I test it using POSTMAN , it returns 401 unauthorized error. Anyone please help to fix this, been few hours trying to figure out this issue.
this is my postman enter image description here
web config:
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<httpRuntime targetFramework="4.5" />
<customErrors mode="Off" />
<sessionState mode="InProc" cookieless="true" timeout="1440" />
<authentication mode="None" />
</system.web>
<system.serviceModel>
<client>
<endpoint address="http://localhost:59900/LoginSVC.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILoginSVC"
contract="ServiceReference1.ILoginSVC" name="BasicHttpBinding_ILoginSVC" />
</client>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ILoginSVC" />
</basicHttpBinding>
<webHttpBinding>
<binding name="webHttpBindingILoginSVC" />
</webHttpBinding>
</bindings>
<services>
<service name="LoginSVC.LoginSVC">
<host>
<baseAddresses>
<add baseAddress="http://localhost:59900/LoginSVC" />
</baseAddresses>
</host>
<endpoint address="soap" binding="basicHttpBinding" contract="LoginSVC.ILoginSVC">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="REST" binding="webHttpBinding" contract="LoginSVC.ILoginSVC" behaviorConfiguration="RESTEndPointBehaviour">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!--To avoid disclosing metadata information, set the values below to false before deployment-->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="RESTEndPointBehaviour">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />
</system.serviceModel>
my interface file :
[OperationContract]
[WebInvoke(Method = "POST",
//UriTemplate = "/Login_checkUser",
BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]
string Login_checkUser(string username, string password);