I need to connect a WCF service to an external WCF service via an API which is returning data in the JSON format.
I have been looking at wsdl and wadl to achieve this but I am not sure whether they were implemented on the external service or how to go about accessing them.
<serviceMetadata>
has been enabled on the external service.
From what I have seen so far wsdl seems to be outdated and only compatible with SOAP, does that sound right? So this being correct, I would naturally prefer to use wadl.
Are these my only options and if so are there any good guides that walk through how to implement these?
Thanks.
This is based on a stripped down version of something I implemented at work and modified (but not tested) to work with JSON (based on some other answers here and on the web):
There are numerous ways to do this, but the above code demonstrates how easy it is (or should be, at least) to do this.
Note that I used the
Result
property for the async calls; if you're making this call from within a method marked asasync
, you could also do:HttpClient
is in theSystem.Net.Http
namespace.