0

I'm new to services so it might be something obvious I'm missing. I was given an example string to pull in some data and it works fine given something like the working query string bellow it will return the JSON I want. When I try to input the same string without the query into the 'Add Service Reference' form in visual studio however I get the following:

There was an error downloading 'https://test.acme.com/PathA/1.0/PathB/Endpoint/_vti_bin/ListData.svc/$metadata'. The request failed with HTTP status 404: Not Found. Metadata contains a reference that cannot be resolved: 'https://test.acme.com/PathA/1.0/PathB/Endpoint'. There was no endpoint listening at a that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (404) Not Found. If the service is defined in the current solution, try building the solution and adding the service reference again.

Working Query String

https://test.acme.com/PathA/1.0/PathB/Endpoint?foo=VALUE&date=2013-01-01

Base String

https://test.acme.com/PathA/1.0/PathB/Endpoint

My question is what is the best way to access the web service. My coworkers mentioned they query the wsdl file to get access to the methods. However querying the following returns nothing. My guess is that there's nothing exposed to list the web service methods, but I wasn't sure why that's allow me to pull in data using the specific URL.

https://test.acme.com/PathA/1.0/PathB/Endpoint?WSDL

adc90
  • 303
  • 3
  • 10

1 Answers1

1

This is old error in VS Add service reference with JSON service

Servie with JSON not work properly in Add service reference

you can checkout this issues hear

can-i-generate-a-service-reference-automatically-for-a-rest-wcf-service mixing-add-service-reference-and-wcf-web-http-a-k-a-rest-endpoint-does-not-work

And i got some workaround for this try thses links :

consume-odata-service-and-get-result-in-json

Consuming-a-Json-WebService-from-a-Csharp-or-VB-Ap

Community
  • 1
  • 1
Jophy job
  • 1,924
  • 2
  • 20
  • 38