Failed to connect to the remote server (web service)

enter image description here

I tried to integrate this web service into my asp.net project, but it is causing such an error! If you have any ideas on this, try me. There are very rare materials about oodle web services and the oodle API.

Try this URL to learn more about my issue http://api.oodle.com/api/v2/listings?key=TEST®ion=chicago&category=vehicle/car

+6
source share
2 answers

It is simply not a SOAP web service. This is a REST XML service. REST services do not provide self-describing metadata in the form of WSDL.

You need another way to communicate with the service. If there is no C # shell, you probably have to write a url generator yourself, and the .NET Framework will deserialize the xml documents for you into beautifully written classes (which you also write yourself).

Try reading more: Oddle Developer Center

EDIT: Also, if you are loading an XML document from a web application, you need to consider a few things.

When you are developing, make sure that you are using Visual Studio as an Administrator .

When deploying to a hosting provider, make sure that you do not use Medium Trust , as this may prevent you from accessing external web sources.

But still I cannot understand why the Add Web Directory dialog cannot connect to the oodle web server. Check network settings, firewall settings, etc. If you can visit the URL in your web browser, you can download the document via code.

+4
source
try { string url = @"http://api.oodle.com/api/v2/listings?key=TEST&region=chicago"; WebClient webClient = new WebClient(); webClient.Encoding = Encoding.UTF8; string result = webClient.DownloadString(url); } catch (Exception ex) { Response.Write(ex.ToString()); } 

This statement throws an exception.

  string result = webClient.DownloadString(url); 

and exception information -

  System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.0.101:808 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadString(Uri address) at System.Net.WebClient.DownloadString(String address) at _Default.lnkGoTo_Click(Object sender, EventArgs e) in d:\MyDemoz\oodleDemo\Default.aspx.cs:line 58 
+4
source

Source: https://habr.com/ru/post/907035/


All Articles