Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web services WSDL和BasicHttpBinding的F#类型提供程序_Web Services_F#_Wsdl_Type Providers - Fatal编程技术网

Web services WSDL和BasicHttpBinding的F#类型提供程序

Web services WSDL和BasicHttpBinding的F#类型提供程序,web-services,f#,wsdl,type-providers,Web Services,F#,Wsdl,Type Providers,当我在C#中使用WSDL服务时,我能够将两个参数传递给构造函数;BasicHttpBinding和EndpointAddress BasicHttpBinding BasicHttpBinding=new BasicHttpBinding{MaxReceivedMessageSize=20000000,MaxBufferSize=20000000}; EndpointAddress EndpointAddress=新的EndpointAddress(delarsListUrl); var ds=

当我在C#中使用WSDL服务时,我能够将两个参数传递给构造函数;BasicHttpBinding和EndpointAddress

BasicHttpBinding BasicHttpBinding=new BasicHttpBinding{MaxReceivedMessageSize=20000000,MaxBufferSize=20000000};
EndpointAddress EndpointAddress=新的EndpointAddress(delarsListUrl);
var ds=新的DealersService.DealersServiceClient(basicHttpBinding,endpointAddress);
当我在F#中使用WSDL类型提供程序时,我只允许在没有任何参数或只有一个BasicHttpBinding类型的参数的情况下调用构造函数。那么如何设置MaxReceivedMessageSize或MaxBufferSize等参数呢

编辑:

如果我将其放到Azure Worker角色的app.config中


这没有帮助,我仍然得到一个例外,maxReceivedMessageSize只有64k,我应该更改它。我在C#中也遇到了同样的问题,app.config设置似乎被忽略了,所以我通过将带有这些设置的BasicHttpBinding传递给构造函数解决了这个问题。

简化数据上下文(通过T.GetDataContext()创建)只公开无参数构造函数和接受EndpointAddress的构造函数。如果要手动设置绑定,可以直接实例化客户端类(它应该位于ServiceTypes内部),即:

type WSDL=Microsoft.FSharp.Data.TypeProviders.WsdlService<@”http://www.webservicex.net/RealTimeMarketData.asmx?WSDL">
let client=new WSDL.ServiceTypes.RealTimeMarketDataSoapClient(…)

From:“有两种方法可以指定WSDL连接的配置设置,一种是使用项目的app.config文件,另一种是使用类型提供程序声明中的静态类型参数”。我想app.config方法更灵活,因为当有多个应用程序使用同一个F#库时,您可能需要单独配置它们。Azure似乎也不是app.config的障碍。@bytebuster我编辑了我的帖子。app.config中的设置似乎不适用于任何好奇的人,此解决方案中的“…”类似于:
new BasicHttpBinding(MaxReceivedMessageSize=200000L)、new EndpointAddress(address)
type WSDL = Microsoft.FSharp.Data.TypeProviders.WsdlService< @"http://www.webservicex.net/RealTimeMarketData.asmx?WSDL">
let client = new WSDL.ServiceTypes.RealTimeMarketDataSoapClient(...)