Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Rest Service Not returning data in browser
    primarykey
    data
    text
    <p>I have a REST service that returns a simple string. When I use WCF Test Client the service returns the expected value, but when I use a browser to access the service, the page comes up empty. Any ideas? All code is below.</p> <p>CUCC.svc.cs</p> <pre><code> public class CUCC : ICUCC { public string AllAtms(string serviceKey) { //return new XElement("AllAtms") ; return "test"; } //public XElement AllOrganizationAtms(string serviceKey, int organizationId) //{ // return new XElement("AllOrganizationAtms"); //} } </code></pre> <p>ICUCC.cs</p> <pre><code>[ServiceContract] public interface ICUCC { [OperationContract] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "AllAtms/{serviceKey}")] string AllAtms(string serviceKey); //[OperationContract] //[WebInvoke(Method = "GET", // ResponseFormat = WebMessageFormat.Xml, // BodyStyle = WebMessageBodyStyle.Wrapped, // UriTemplate = "AllAtms/{serviceKey}/{organizationId}")] //XElement AllOrganizationAtms(string serviceKey, int organizationId); } </code></pre> <p>web.config</p> <pre><code>&lt;configuration&gt; &lt;configSections&gt; &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt; &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt; &lt;/configSections&gt; &lt;appSettings /&gt; &lt;system.web&gt; &lt;compilation debug="true" targetFramework="4.0"&gt; &lt;assemblies&gt; &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt; &lt;/assemblies&gt; &lt;/compilation&gt; &lt;httpRuntime /&gt; &lt;/system.web&gt; &lt;system.serviceModel&gt; &lt;services&gt; &lt;service name="CUCC.AllAtms" behaviorConfiguration="ServiceBehaviour"&gt; &lt;endpoint address="" binding="webHttpBinding" contract="CUCC.AllAtms" behaviorConfiguration="web"&gt;&lt;/endpoint&gt; &lt;/service&gt; &lt;/services&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="ServiceBehaviour"&gt; &lt;serviceMetadata httpGetEnabled="true" httpsGetBinding="true"/&gt; &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt; &lt;/behavior&gt; &lt;behavior&gt; &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt; &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /&gt; &lt;!-- 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 --&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;endpointBehaviors&gt; &lt;behavior name="web"&gt; &lt;webHttp/&gt; &lt;/behavior&gt; &lt;/endpointBehaviors&gt; &lt;/behaviors&gt; &lt;protocolMapping&gt; &lt;add binding="basicHttpsBinding" scheme="https" /&gt; &lt;/protocolMapping&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" /&gt; &lt;/system.serviceModel&gt; &lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true" /&gt; &lt;!-- 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. --&gt; &lt;directoryBrowse enabled="true" /&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <h2>UPDATE</h2> <p>Sorry, forgot to include the url that I am using.</p> <pre><code>http://localhost:51870/CUCC.svc/AllAtms/testing </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload