locked
JSON,WCF service RRS feed

  • Question

  • User892410294 posted

    Hi , plz look at this. i do not know why it is showing error, help me out. 

    Error: Cannot obtain Metadata from http://localhost:50115/Service1.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://localhost:50115/Service1.svc    Metadata contains a reference that cannot be resolved: 'http://localhost:50115/Service1.svc'.    The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.HTTP GET Error    URI: http://localhost:50115/Service1.svc    There was an error downloading 'http://localhost:50115/Service1.svc'.    The request failed with the error message:--<html>    <head>        <title>Configuration Error</title>        <style>         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}          p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }         pre {font-family:"Lucida Console";font-size: .9em}         .marker {font-weight: bold; color: black;text-decoration: none;}         .version {color: gray;}         .error {margin-bottom: 10px;}         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }        </style>    </head>    <body bgcolor="white">            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>            <h2> <i>Configuration Error</i> </h2></span>            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">            <b> Description: </b>An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.            <br><br>            <b> Parser Error Message: </b>There is no endpoint behavior named 'webBehaviour'.<br><br>            <b>Source Error:</b> <br><br>            <table width=100% bgcolor="#ffffcc">               <tr>                  <td>                      <code><pre>Line 8:      <services>Line 9:        <service name="WcfService6.Service1" behaviorConfiguration="WcfService6.Service1Behavior"><font color=red>Line 10:         <endpoint address="../Service1.svc" binding="webHttpBinding" contract="WcfService6.IService1" behaviorConfiguration="webBehaviour"/></font>Line 11:       </service>Line 12:     </services></pre></code>                  </td>               </tr>            </table>            <br>            <b> Source File: </b> c:\users\wfchristhu\documents\visual studio 2010\Projects\WcfService6\WcfService6\web.config<b> ÿÿ Line: </b> 10            <br><br>            <hr width=100% size=1 color=silver>            <b>Version Information:</b>ÿMicrosoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272            </font>    </body></html><!-- [ConfigurationErrorsException]: There is no endpoint behavior named 'webBehaviour'. (c:\users\wfchristhu\documents\visual studio 2010\Projects\WcfService6\WcfService6\web.config line 10)   at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)   at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)   at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName, VirtualPath path)   at System.Web.Configuration.WebConfigurationManager.GetSection(String sectionName, String path)   at System.ServiceModel.Activation.HostedAspNetEnvironment.UnsafeGetSectionFromWebConfigurationManager(String sectionPath, String virtualPath)   at System.ServiceModel.Activation.HostedAspNetEnvironment.UnsafeGetConfigurationSection(String sectionPath)   at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath)   at System.ServiceModel.Description.ConfigLoader.LookupService(String serviceConfigurationName)   at System.ServiceModel.ServiceHostBase.ApplyConfiguration()   at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)   at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses)   at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)   at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)   at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)[ServiceActivationException]: The service '/Service1.svc' cannot be activated due to an exception during compilation.  The exception message is: There is no endpoint behavior named 'webBehaviour'. (c:\users\wfchristhu\documents\visual studio 2010\Projects\WcfService6\WcfService6\web.config line 10).   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService)   at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e)   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)-->--.

    Monday, July 29, 2013 1:11 AM

Answers

  • User260886948 posted

    Christxavier

    Error: Cannot obtain Metadata from http://localhost:50115/Service1.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. 

    Hi,

    When meet the above error, you may need to add a metadata exchange (MEX) endpoint to your service node.

    Please try something like this:

    <endpoint
        address="http://localhost:50115/Service1.svc/mex"
        binding="mexHttpBinding"
        bindingConfiguration=""
        contract="IMetadataExchange"/>

    And it will be better, if you edit your question with good format.

    Best Regards,
    Amy Peng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 29, 2013 9:48 PM

All replies

  • User260886948 posted

    Christxavier

    Error: Cannot obtain Metadata from http://localhost:50115/Service1.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. 

    Hi,

    When meet the above error, you may need to add a metadata exchange (MEX) endpoint to your service node.

    Please try something like this:

    <endpoint
        address="http://localhost:50115/Service1.svc/mex"
        binding="mexHttpBinding"
        bindingConfiguration=""
        contract="IMetadataExchange"/>

    And it will be better, if you edit your question with good format.

    Best Regards,
    Amy Peng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 29, 2013 9:48 PM
  • User503812343 posted

    If it is JSON enabled service have you added the WebGet attributes for your WCF operations

    click here to know how to create WCF service with JSON format request and reply

    Tuesday, July 30, 2013 10:59 AM