How to specify a web proxy for help on the service?

I found a simple web service on the Internet http://chennaiemergency.co.in/sree/s2.php?wsdl , which I can call through the SOAP user interface using 2 float values โ€‹โ€‹(1,1) and easily get an answer within 1-2 seconds. Now, in the new Visual Studio 2010 console project, I am doing an โ€œadd service linkโ€ and providing WSDL. Then in the resulting client, I do this:

ServiceReference1.ChnEmergencyPortTypeClient client = new ChnEmergencyPortTypeClient(); string hospital = client.hospital(1, 1); 

I get a timeout exception after 1 minute. I probably turned off the firewall. I use Windows7x64 I use the Internet through a proxy server.

I tried the same thing by adding a web link, but I have the same timeout error.

Now, in the implementattio web reference, I made several modifications:

  WebProxy webProxy = new WebProxy("<my proxy server name>", <port>); ChnEmergency client = new ChnEmergency(); client.Timeout = 200000; client.Proxy = webProxy; string hospital = client.hospital(1, 1); 

But I still get a timeout. Any suggestions I'm missing?

I did a quick test using a direct (via phone) interconnect that does not include proxies. And I was able to successfully access. This means that there is an error in the way I provide web proxies. IE Internet settings show that my proxy settings:

Address: abccom Port: 80

So, I am running such a web proxy

 WebProxy webProxy = new WebProxy("abccom", 80); 

Now I donโ€™t know if there is some kind of โ€œsecure httpโ€ concept somewhere, and I donโ€™t know how to understand this. But try the browser with http: // abccom and https: // abccom gave different results. In the case of "http", I received this invalid URL. In the case of "https" the error "Error connecting Google Chrome to abccom was rejected. The website may not be available, or your network may be configured incorrectly"

If I use webproxy with https, it says: "service point manager is not configured for https"

I used a violinist to see the actions, and I see that the request appears in the violinist. But there is no answer. Does this mean that the request is passing? Or the request may be blocked at a lower level (i.e., after it passes through the violinist).

+7
source share
2 answers

Well, it turns out that the proxy server I used, proxyA, was redirected inturn to another proxyB proxy. Using proxyB directly resolved the issue. Someone else found out about this, I did not understand myself. I used a proxy object, for example WebProxy webProxy = new WebProxy ("proxyB.com", 80). Therefore, the problem is not resolved, but resolved at the moment.

0
source

I tried to quickly create a small web project and it seems to work fine, but as you added webservice, it returns xml as follows:

 <?xml version="1.0" encoding="ISO-8859-1"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:hospitalResponse xmlns:ns1="urn:ChnEmergency"> <return xsi:type="xsd:string">12.944672~80.134578~Chrompet GH~Government~GST Road, Chrompet~Chrompet~600036</return> </ns1:hospitalResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 

If your proxy needs a password, you can try:

 var proxy = new WebProxy("proxy.foo.com", 8080); proxy.Credentials = new NetworkCredential("user", "pass"); WebRequest.DefaultWebProxy = proxy; 
0
source

All Articles