I have a thick client which opens channels on several WCF services. The services are built using C#, WCF, nHibernate, Fluent and Unity (ServiceHostFactory).
When I try to access the MetaData for Plate.svc through the browser I get a 400 bad request which generates no log statements although the good requests from the app do. All requests from the app work normally.
Any ideas?
I've included the important bits of the following files:
- Service markup
- Service Contract
- Service Web.config
- Client App.config
1. Service Markup
ServiceHost Language="C#" Debug="true" Service="PRO.Services.PlateService" CodeBehind="Plate.svc.cs" Factory="PRO.Services.Configuration.UnityServiceHostFactory"
2. Service Contract
namespace PRO.ServiceContracts { [ServiceContract] public interface IPlateService { [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest)] [FaultContract(typeof(string))] AnalysisPlate Search(string barcode); // identically defined operations removed } }
3. Service Web.config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ProBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
<services>
<service behaviorConfiguration="ProBehavior" name="PRO.Services.PlateService">
<endpoint address="" contract="PRO.ServiceContracts.IPlateService"
binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="ProBehavior" name="PRO.Services.SampleService">
<endpoint address="" contract="PRO.ServiceContracts.ISampleService"
binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding"/>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>
4. Client App.config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_Normal">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:4829/Sample.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Normal" contract="PRO.ServiceContracts.ISampleService" name="DEV_ISampleService" />
<endpoint address="http://localhost:4829/Plate.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Normal" contract="PRO.ServiceContracts.IPlateService" name="DEV_IPlateService" />
</client>
</system.serviceModel>