0

I have this service that was working great until I changed the namespace of the service. Also changed the default namespace in the project. I was getting some errors something about not publishing metadata, so I undid my changes, and not nothing works. I even created a new service to test getting this going again, and not I am getting an http 400 when I try to test my rest service. It's been a long week, and I am fully pulling my hair out. Can anyone see what I am doing wrong here?

Update: The http 400 is gone, this is the error I am seeing:Error: Cannot obtain Metadata from http://localhost:1585/ProdSvc.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

[OperationContract]
void DoWork();

[OperationContract]
   [WebInvoke(Method = "GET", 
       ResponseFormat = WebMessageFormat.Xml,
       BodyStyle = WebMessageBodyStyle.Bare, 
   UriTemplate = "GetProductName/")]
   string GetProductName();

public string GetProductName()
{
    return "It worked!!!";
}

<system.serviceModel>
    <services>
      <service name="TSServices.ProdSvc" behaviorConfiguration="serviceBehavior">
        <endpoint address=""
                               binding="webHttpBinding"
                               contract="TSServices.ProdSvc"
                              behaviorConfiguration="web"></endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
BriceTRockindale
  • 309
  • 1
  • 4
  • 15
  • Have you looked at this? http://stackoverflow.com/questions/6056329/error-cannot-obtain-metadata-from-wcf-service – supertopi Jan 31 '15 at 10:49

1 Answers1

0

Supertopi's answer was correct. Adding the config sections did the trick.

BriceTRockindale
  • 309
  • 1
  • 4
  • 15