遗憾的是,类型提供程序无法(在设计时)静态地知道在哪里寻找配置文件,因此它会忽略它.I am following the MSDN tutorial for the WsdlService type provider found here. When I run it at home, it works as expected. When I write the same code at work, I am getting a design time exception: Work does use a proxy and I have to alter the web.config to use a default proxy when consuming WSDL from a C# project in VS2012. When I looked at the parameters for the type provider, I don't see a mention about a proxy. Does anyone have any suggestions?Thanks in advance. 解决方案 I'm not connecting through a proxy, so I have no way of actually testing this, but I think you should be able to use local WSDL file to load the type provider in the designer.Try downloading the WSDL schema (from http://msrmaps.com/TerraService2.asmx?WSDL) and saving that to a local file (such as C:\temp\terra.wsdlschema). Then you should be able to write:#r "System.ServiceModel.dll"#r "FSharp.Data.TypeProviders.dll"open Microsoft.FSharp.Data.TypeProviderstype Terra = WsdlService< ServiceUri="N/A", ForceUpdate = false, LocalSchemaFile = @"C:\temp\terra.wsdlschema">let terra = Terra.GetTerraServiceSoap()terra.GetPlaceList("New York", 1, false)The ServiceUri parameter seems to be required, but it should be ignored if you add ForceUpdate=false. It should only require the cached WSDL file. I'm not entirely sure how to configure the runtime to use your config file setting, but I'm sure this can be done in some way (either it just works or you can pass something to the GetTerraServiceSoap method).Sadly, the type provider does not statically know (at design time) where to look for the config file, so it ignores it. 这篇关于F#WsdlService类型提供程序代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-06 02:08