2011-02-09 35 views
2

我遇到的情況,我需要使用svcutil.exe的消費服務,但該服務的WSDL包含以下幾個部分使用svcutil.exe的一個webproxy

<xsd:schema targetNamespace="http://tempuri.org/Imports"> 
    <xsd:import schemaLocation="http://mysite/service.svc?xsd=xsd0" namespace="http://tempuri.org/"/> 
    <xsd:import schemaLocation="http://mysite/service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/> 
    <xsd:import schemaLocation="http://mysite/service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/Pensjonskalkulator"/> 
    <xsd:import schemaLocation="http://mysite/service.svc?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/> 
</xsd:schema> 

問題是,這些模式的位置只通過webproxy訪問。如果我在IE設置中設置代理,我可以瀏覽IE中的模式位置。但是看起來svcutil.exe在下載這些額外模式時會忽略這些設置。

下載額外信息時如何讓svcutil.exe使用我的webproxy?

更新:實際上,在Internet Explorer中輸入的代理設置適用於svcutil.exe。這是其他無關的問題導致我的問題。

回答

1

可以通過在Internet Explorer - >工具 - > Internet選項 - >連接 - >局域網設置 - >代理服務器中設置svcutil.exe來使用代理,然後指定地址和端口。

1

您可以添加這svcutil.config

<system.net> 
    <defaultProxy>  
    <proxy proxyaddress="http://your.proxy.com:8080" bypassonlocal="true" /> 
    </defaultProxy> 
</system.net> 

如果你的代理需要身份驗證是指this answer提供用戶名/密碼和/或域名。

+0

這似乎沒有任何影響,但好建議。 – Xorandor 2011-02-09 14:15:02