Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is the c# code which i use to bypass proxy to access the webservice since my system is using proxy. iam using VS 2010 and using the webservice in my windows application.

C#
WebRequest.DefaultWebProxy = new WebProxy("http://IN02S10004:80/", true);


But still i get the error as follows.

C#
system.invalidoperationexception client found response content type of text/html but expected 'text/xml'


also tried with the following code in app.config also

C#
<system.net>
   <defaultProxy>
     <proxy usesystemdefault="false"
         proxyaddress="http://IN02S10004:80"
         bypassonlocal="true"/>
     <bypasslist>
       <add address="http://www.webservicex.net/periodictable.asmx"/>
     </bypasslist>
   </defaultProxy>
 </system.net>
Posted
Updated 4-Jul-12 19:11pm
v2

Perhaps you need to login to the proxy?

WebProxy provides a constructor that takes credentials for Proxies[^]

Best bet is have a look at the HTML you're getting back instead of XML - it probably has some info in it
 
Share this answer
 
v2
Comments
shamypnr 5-Jul-12 1:13am    
there is no credentials and the webservice which i use is a free one.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900