How to run svcutil.exe from behind authenticating proxy

。_饼干妹妹 提交于 2019-12-01 01:12:40

问题


I want to run the svcutil.exe tool to access a web service on the internet. Unfortunately, whenever I try, I get a bunch of errors that include the following message:

The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied.

As I have learned from this related post (with more details here), the problem is that I am sitting behind an authenticating proxy. That post explains that I need to edit the app.config file, but I can't figure out how to do that. I think I will use the /svcutilConfig:alternate_app.config switch, but I don't know how to construct a valid .config file to pass to that switch. What is the default app.config file that svcutil.exe uses?


回答1:


Well, I think I have figured out the answer to my question:

It turns out that the default .config file used by svcutil.exe is called svcutil.exe.config, and (at least for me) it lives in this folder:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin

I decided to just edit that file directly (rather than fumble around with the /svcutilConfig switch). I needed Admin privileges to do so.

The final contents of that file looked like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <generatePublisherEvidence enabled="false" />
  </runtime>
  <system.net> 
    <defaultProxy useDefaultCredentials="true" /> 
  </system.net>
</configuration>

(with the secret sauce buried in the <system.net> element.)

In order for this all to work, I had to start the Command Prompt as Administrator, navigate to the folder listed above, and run the svcutil.exe command from there.

Hope this helps some other poor soul who gets stuck in this mess! Thanks to @AndrewWebb for the clues that got me going!



来源:https://stackoverflow.com/questions/15124350/how-to-run-svcutil-exe-from-behind-authenticating-proxy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!