I'm familiar with SOAP services and how they're used, but I recently was given a service URL to a JSON service and was wondering if I could use it in my C# project. I've tried adding a service reference to the URL:
http://www.bungie.net/stats/reach/ReachJson.svc
And it does find the service, along with two methods. I named the service reference "ReachJson" , and added a using line to my code:
using WindowsFormsApp lication2.Reach Json;
Then I tried creating a client in two different ways. First:
ReachJsonClient client = new ReachJsonClient ();
With this I get the following error on the line where I create the client:
Then I tried this:
static ReachJsonClient client = new ReachJsonClient ();
And got this error on my Application.Run () line in program.cs:
Is there anything I can do to get this working, or would that all be on the side of the service host?
http://www.bungie.net/stats/reach/ReachJson.svc
And it does find the service, along with two methods. I named the service reference "ReachJson" , and added a using line to my code:
using WindowsFormsApp lication2.Reach Json;
Then I tried creating a client in two different ways. First:
ReachJsonClient client = new ReachJsonClient ();
With this I get the following error on the line where I create the client:
Could not find default endpoint element that references contract 'ReachJson.IRea chJson' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
static ReachJsonClient client = new ReachJsonClient ();
And got this error on my Application.Run () line in program.cs:
The type initializer for 'WindowsFormsAp plication2.Form 1' threw an exception.
Comment