1

Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.

The Address property on ChannelFactory.Endpoint was null.  The ChannelFactory's Endpoint must have a valid Address specified.
   at System.ServiceModel.ChannelFactory.CreateEndpointAddress(ServiceEndpoint endpoint)
   at System.ServiceModel.ChannelFactory`1.CreateChannel()
   at System.ServiceModel.ClientBase`1.CreateChannel()
   at System.ServiceModel.ClientBase`1.CreateChannelInternal()
   at System.ServiceModel.ClientBase`1.get_Channel()
   at InstantBankVerificationPostBackClient.PostBack(String data)

Web.Config:

<services>
    <service behaviorConfiguration="DebugJSonBehavior" name="IBVWebService.InstantBankVerificationPostBack">
        <endpoint address="http://localhost:64337/InstantBankVerificationPostBack.svc" 
            binding="webHttpBinding"
            contract="IBVWebService.IInstantBankVerificationPostBack"
            behaviorConfiguration="webBehavior">
            <identity>
              <dns value="localhost" />
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
</services>

<behaviors>
    <endpointBehaviors>
        <behavior name="webBehavior">
            <webHttp/>
        </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
        <behavior name="DebugJSonBehavior">
            <serviceMetadata httpGetEnabled="true" />
            <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
        </behavior>
    </serviceBehaviors>
</behaviors>

Interface:

[OperationContract]
[WebInvoke(Method = "POST",
BodyStyle = WebMessageBodyStyle.WrappedRequest,
RequestFormat = WebMessageFormat.Json)]
void PostBack(string data);
cramopy
  • 3,459
  • 6
  • 28
  • 42
Tyler Buchanan
  • 311
  • 1
  • 4
  • 18

1 Answers1

0

So I believe I am getting this error because of using the WCF client tool which currently doesn't work with wcf using json. I tried with fiddle and i get something different HTTP/1.1 400 Bad Request.

Tyler Buchanan
  • 311
  • 1
  • 4
  • 18
  • WCFTestClient is for SOAP only, not REST. See http://stackoverflow.com/a/7479609/745969 – Tim Jun 12 '15 at 20:59