0

Once again, as a beginner with WCF, MVC and Sharp Architecture, i might asking a stupid question, so bear with me.

I'm finally able to make the Northwind example of Sharp Architecture work.

I can browse the service using internet browser localhost/NorthwindWcfServices/TerritoriesService.svc localhost/NorthwindWcfServices/TerritoriesService.svc?wsdl

I can invoke the service GetTerritories using WcfTestClient.exe

And then i use Fiddler to test it : Fiddler is ok when i Request a GET : localhost/NorthwindWcfServices/TerritoriesService.svc?wsdl

when i start requesting localhost/NorthwindWcfServices/TerritoriesService.svc/GetTerritories

They keep giving me a 400 Bad Request error.

Is there something i should do to make it work ?

Should i add a content-type in fiddler header request ? or should i add any attribute in the service class ?

Any help will be much appreciated.

Thanks

puntapret
  • 201
  • 4
  • 10

1 Answers1

0

You have to configure the Service using the Web config file for example if u configure the WCF for accessing ... your service config should look something like this

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="EndPBehavior">
      <webHttp/>
      <enableWebScript/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<services>
  <service behaviorConfiguration="ServiceBehavior" name="CastleTest.WCF.WCFService">
    <endpoint address="" binding="webHttpBinding"
              contract="CastleTest.WCF.IWCFService"
              behaviorConfiguration="EndPBehavior"/>
  </service>
</services>

try it and see if the error 400 goes or not

Joy
  • 6,438
  • 8
  • 44
  • 75