Provider Provider Type W # WsdlService

I am following an MSDN tutorial for a provider of type WsdlService, found here . When I run it at home, it works as expected. When I write the same code at work, I get a development-time exception:

A provider of type 'Microsoft.FSharp.Data.TypeProviders.DesignTime.DataProviders' reported an error: Error: Unable to get metadata from http://msrmaps.com/TerraService2.asmx?WSDL

The work uses a proxy server, and I have to change web.config to use the default proxy when using WSDL from a C # project in VS2012. When I looked at the parameters for the type provider, I do not see a mention about the proxy. Anyone have any suggestions?

Thanks in advance.

+1
source share
2 answers

I am not connecting through a proxy server, so I have no way to test it, but I think you should use the local WSDL file to load the type provider in the constructor.

Try downloading the WSDL schema (from http://msrmaps.com/TerraService2.asmx?WSDL ) and save it in a local file (for example, C:\temp\terra.wsdlschema). Then you can write:

#r "System.ServiceModel.dll"
#r "FSharp.Data.TypeProviders.dll"
open Microsoft.FSharp.Data.TypeProviders

type Terra = WsdlService< ServiceUri="N/A", ForceUpdate = false, 
                          LocalSchemaFile = @"C:\temp\terra.wsdlschema">
let terra = Terra.GetTerraServiceSoap()
terra.GetPlaceList("New York", 1, false)

ServiceUri , , ForceUpdate=false. WSDL. , , , - ( , - GetTerraServiceSoap).

, ( ), , .

+3

...

:

  • , - (, , -,...), . (, DB, ODATA $, WSDL...) , LocalSchemaFile="...", ForceUpdate=false . TP , .
  • , , .

, .

WSDL - (.. №2). Cribbed , , #. , , , .

#r "System.ServiceModel.dll"
#r "FSharp.Data.TypeProviders.dll"
open Microsoft.FSharp.Data.TypeProviders

type Terra = WsdlService< ServiceUri="N/A", ForceUpdate = false, 
                          LocalSchemaFile = @"C:\temp\terra.wsdlschema">
let terra = Terra.GetTerraServiceSoap()

let binding = terra.DataContext.Endpoint.Binding :?> System.ServiceModel.BasicHttpBinding
binding.ProxyAddress <- System.Uri("http://127.0.0.1:8888")
binding.BypassProxyOnLocal <- false
binding.UseDefaultWebProxy <- false

terra.GetPlaceList("New York", 1, false)
+5

All Articles