Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
There was no endpoint listening at http://localhost:7783/GetDataService.svc/JSONData that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Posted
Updated 27-Jul-16 1:13am

Hi Ganesh,

I got same issue at clint apllication. But it worked when i change property in service interface like below:

[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare)]
 
Share this answer
 
v2
Comments
Ganeshh2 11-May-13 5:53am    
Hi Vijay,

Thank u very much..
u r posted exact solution to my issue. my problem was solved with ur solution.
Mohammed Hameed 11-May-13 6:03am    
Congrats Ganesh & Thanks Vijay...

Sorry, unfortunately my solution didn't work. Anyhow good that I have also learnt something. Thanks...
Hi Ganesh,

Check the service url (Check the url by opening it in any browser like Internet explorer.): http://localhost:7783/GetDataService.svc/JSONData[^] whether it is running or not.

If not, then you have to right click on the SVC file and select open in web browser option.

This could resolve the issue. But if you still face the issue please let me know.
 
Share this answer
 
v2
Comments
Ganeshh2 10-May-13 1:21am    
Hi Mohammed,

my WCF service address is "http://localhost:7783/GetDataService.svc" it is working. But when iam trying to call the service method "JSONData()" from my web application it gives the above exception "http://localhost:7783/GetDataService.svc/JSONData". what i need to do?
Mohammed Hameed 10-May-13 1:31am    
Okay, good that service is running fine. Could you double check the endpoints in the config file.
Also, use WCFTestClient.exe to test whether the method JSONData() is running fine or not. It is located somewhere here: "C:\Program Files\Microsoft Visual Studio 10.0\Common7\
Ganeshh2 10-May-13 2:02am    
Yes, its running in WCFTestClient.exe. now it's showing exception like this "The remote server returned an unexpected response: (405) Method Not Allowed." in my web application.
Mohammed Hameed 10-May-13 2:20am    
Hmmm. Then probably there is an issue with the method JSONData() itself. So, put a breakpoint in the method and run the application by attaching your service app to it (or by running service in wcfTestClient) for debugging purpose. By this, you can trace whats wrong going on in the method. This should probably get you the real problem and hence you can resolve as well.

Do update me for any queries...
Ganeshh2 10-May-13 4:02am    
JSONDATA() method is running perfectly in WCFTestClient.exe tool, but my problem is when that method is calling from my web application it gives this exceptiom "The remote server returned an unexpected response: (405) Method Not Allowed." in my web application".
Service config file:
XML
<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <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>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>



App Config file:

HTML
<pre>
<configuration>
  
    <system.servicemodel>
        <bindings>
            <basichttpbinding>
                <binding name="BasicHttpBinding_IMainService" closetimeout="00:01:00">
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerquotas maxdepth="32" maxstringcontentlength="8192" maxarraylength="16384">
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientcredentialtype="None" proxycredentialtype="None">
                            realm="" />
                        <message clientcredentialtype="UserName" algorithmsuite="Default" />
                    </transport></security>
                </readerquotas></binding>
            </basichttpbinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:1298/MainService.svc" binding="basicHttpBinding">
                bindingConfiguration="BasicHttpBinding_IMainService" contract="MainServiceAgent.IMainService"
                name="BasicHttpBinding_IMainService" />
        </endpoint></client>
    </system.servicemodel>
</configuration>
 
Share this answer
 
Comments
Ganeshh2 10-May-13 7:47am    
good mohammed, but by using basicHttpBinding i got the out put but we didnot get "Json" format data right. for Json data "webHttpbinding" must be use right. for webHttpBinding" i got that exception. please give explanation.
Mohammed Hameed 10-May-13 7:51am    
Hmmm. Okay atleast by now we got to know the real issue. Thats great... Anyhow I dont know much about using Json (as I have used it very long ago). But I would suggest u to read this short article on it: "http://www.codeproject.com/Articles/327420/WCF-REST-Service-with-JSON" I hope it would give u an idea to fix ur problem.
Ganeshh2 10-May-13 7:59am    
Thank you very much mohammed i will go through that link.
Mohammed Hameed 10-May-13 8:00am    
You're welcome :)
Mohammed Hameed 10-May-13 9:45am    
Any luck Ganesh?
C#
Hi Mohammed i have the same issue <big><small></small></big> please what is wrong with my service web config and Client app config

Service config


<system.servicemodel>

<services>

<service name="ProductWebserviceapp.Product" behaviorconfiguration="ServiceBehavior">

<endpoint binding="webHttpBinding" contract="ProductWebserviceapp.IProduct">
behaviorConfiguration="webHttp">
<identity>
<dns value="localhost">



<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">


<servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true">
<standardendpoints>
<webhttpendpoint>
<standardendpoint name="">
helpEnabled="true"
automaticFormatSelectionEnabled="true"
defaultOutgoingResponseFormat="Json"
crossDomainScriptAccessEnabled="true"/>


<behaviors>
<servicebehaviors>

<behavior name="ServiceBehavior">
<servicemetadata httpgetenabled="true">
<servicedebug includeexceptiondetailinfaults="true">
<datacontractserializer maxitemsinobjectgraph="50485760">






<behavior>

<servicemetadata httpgetenabled="true">

<servicedebug includeexceptiondetailinfaults="false">



<endpointbehaviors>
<behavior name="webHttp">
<webhttp helpenabled="True">






<bindings>






<system.webserver>
<modules runallmanagedmodulesforallrequests="true">





App config

<system.servicemodel>

<client>
<endpoint address="http://localhost/ProductPublish/Product.svc">
binding="webHttpBinding"
behaviorConfiguration="webEndpoint"
contract="Product.IProduct"
name="SinglePageAngularJS.Product" />

<behaviors>
<endpointbehaviors>
<behavior name="webEndpoint">
<webhttp defaultbodystyle="Wrapped">
defaultOutgoingResponseFormat="Xml"
helpEnabled="true"/>






<appsettings>
<add key="webpages:Version" value="2.0.0.0">
<add key="webpages:Enabled" value="false">
<add key="PreserveLoginUrl" value="true">
<add key="ClientValidationEnabled" value="true">
<add key="UnobtrusiveJavaScriptEnabled" value="true">

<system.web>
<compilation debug="true" targetframework="4.5">
<httpruntime targetframework="4.5">
<authentication mode="Forms">
<forms loginurl="~/Account/Login" timeout="2880">

<pages>
<namespaces>
<add namespace="System.Web.Helpers">
<add namespace="System.Web.Mvc">
<add namespace="System.Web.Mvc.Ajax">
<add namespace="System.Web.Mvc.Html">
<add namespace="System.Web.Optimization">
<add namespace="System.Web.Routing">
<add namespace="System.Web.WebPages">



<system.webserver>
<validation validateintegratedmodeconfiguration="false">
<handlers>
<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">

<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="System.Web.Helpers" publickeytoken="31bf3856ad364e35">
<bindingredirect oldversion="1.0.0.0-2.0.0.0" newversion="2.0.0.0">

<dependentassembly>
<assemblyidentity name="System.Web.Mvc" publickeytoken="31bf3856ad364e35">
<bindingredirect oldversion="1.0.0.0-4.0.0.0" newversion="4.0.0.0">

<dependentassembly>
<assemblyidentity name="System.Web.WebPages" publickeytoken="31bf3856ad364e35">
<bindingredirect oldversion="1.0.0.0-2.0.0.0" newversion="2.0.0.0">



<entityframework>
<defaultconnectionfactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v12.0">




Please solve this issue i am very upset
 
Share this answer
 
Comments
Richard Deeming 27-Jul-16 8:12am    
If you want to ask a question, then ASK A QUESTION[^].

DO NOT post your question as a "solution" to someone else's question - particularly not when that question was solved THREE YEARS AGO.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900