I have got error in wcf service

Posted by Shail under WCF on 10/27/2015 | Points: 10 | Views : 2005 | Status : [Member] | Replies : 2
Could not find default endpoint element that references contract 'WebPortal.WebPortal' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element

my webconfig file is:

<?xml version="1.0"?>

<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
<service name="OMS.Services.Host.WebPortal.Svc">
<endpoint address="http://localhost:14055/WebPortal.svc" behaviorConfiguration="OMS.Services.Host.Service1AspNetAjaxBehavior"
binding="webHttpBinding" contract="OMS.Services.Contracts.IWebPortalService" />
<behavior name="OMS.Services.Host.Service1AspNetAjaxBehavior">
<enableWebScript />
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<add binding="basicHttpsBinding" scheme="https" />
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<modules runAllManagedModulesForAllRequests="true"/>
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
<directoryBrowse enabled="true"/>



Posted by: Sheonarayan on: 10/27/2015 [Administrator] HonoraryPlatinum | Points: 25

Is your service project building successfully? If yes, try to run it from the visual studio itself and try to invoke the service to test you are getting desired output. Once this is done, then try to consume this service with the correct url where it is hosted.

Generally, it may happen that your service url is different and you are trying to target different url. In live server, you will have to change the service url from web.config of your project.


Sheo Narayan

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhupentiwari on: 11/9/2015 [Member] Starter | Points: 25

Default end point in your code .http://localhost:14055/WebPortal.svc , Pls change this

Thanks n Regards
Bhupendra Tiwari

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response