Ok. So I have a fully functional WCF REST Service. I can use Fiddler and send it JSON and get the expected responses.
So far so good.
But when I try to add a service reference in a .Net project I throw an error when I try to create the service (Please refer to Adding WCF Service Does Not Add Meaningful configuration.svc.info - I think I’ve found the root cause but it’s sufficiently different that I decided to open another question.)
Note that it’s not Visual Studio. I can add references to other services just fine and multiple different installs of VS won’t work with my service.
I think that root cause is that my WSDL file is incorrect. There is a sample that Microsoft provides here - https://msdn.microsoft.com/en-us/library/windows/desktop/dd323317(v=vs.85).aspx and a live example here - http://www.webservicex.com/globalweather.asmx?wsdl
The upshot is that both examples have a lot more that I have when calling my WSDL https://marius.activistmanager.com/1_0_0.svc?wsdl
But when I use the single page WSDL I get all kinds of information - https://marius.activistmanager.com/1_0_0.svc?singleWsdl
I think it’s a problem is in my WCF Service’s Web.config file where I set the end point.
Does anyone see a problem with my code that would cause the problem I discussed in the other question? I would be delighted to find that I'm just doing something stupid.
<client>
<endpoint address="https://apitest.authorize.net/soap/v1/Service.asmx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="AuthorizeNetCIMTest.ServiceSoap" name="ServiceSoap" />
</client>
<services>
<service name="Marius.Marius_1_0_0" behaviorConfiguration="metadataSupport">
<endpoint address="" behaviorConfiguration="Marius.MariusAspNetAjaxBehavior" bindingConfiguration="TransportSecurity" contract="Marius.Marius_1_0_0" binding="webHttpBinding" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<!--This is the transport the all the services use. It specifies that all the connections have to use HTTPS. Since there are no bindings for HTTP all those connections will 404-->
<bindings>
<basicHttpBinding>
<binding name="ServiceSoap">
<security mode="Transport" />
</binding>
<binding name="ServiceSoap1" />
</basicHttpBinding>
<webHttpBinding>
<binding name="TransportSecurity">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<!-- Enables the IMetadataExchange endpoint in services that -->
<!-- use "metadataSupport" in their behaviorConfiguration attribute. -->
<!-- In addition, the httpGetEnabled and httpGetUrl attributes publish -->
<!-- Service metadata for retrieval by HTTP/GET at the address -->
<!-- "http://localhost:8080/SampleService?wsdl" -->
<serviceMetadata httpsGetEnabled="true" policyVersion="Policy15" httpsGetUrl="" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="Marius.MariusAspNetAjaxBehavior">
<webHttp defaultOutgoingResponseFormat="Json" />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
John was correct - here's a description of the problem (http://blogs.msdn.com/b/carlosfigueira/archive/2012/03/26/mixing-add-service-reference-and-wcf-web-http-a-k-a-rest-endpoint-does-not-work.aspx). Looks like the only option is write some code using RestSharp. Ugh.