ssl - ODataService Type Provider error: (401) Unauthorized -


the type provider 'microsoft.fsharp.data.typeproviders.designtime.dataproviders' reported error: error reading schema. remote server returned error: (401) unauthorized.

is there way use odata type provider odata service requires username , password?

static type parameters type provider:

  • serviceuri : string uri string odata service.
  • localschemafile : string path file contains schema. file written type provider.
  • forceupdate : bool requires direct connection service available @ design/compile time , local service file refreshed. default value true. when forceupdate false, provider reacts changes in localschemafile.
  • resolutionfolder : string folder used resolve relative file paths @ compile time. default value folder contains project or script.
  • dataservicecollection : bool generates collections derived dataservicecollection. default value false.

yes, unfortunately it's not quite slick, , don't compile-time validation, 1 of nice benefits of type providers.

you need grab $metadata service , save locally .csdl file, use localschemafile static parameter in code. can set credentials on data context object in order authenticate @ runtime.

// download http://services.odata.org/northwind/northwind.svc/$metadata local file metadata.csdl type northwind = odataservice<"http://services.odata.org/northwind/northwind.svc/",                               localschemafile="metadata.csdl",                               forceupdate=false>  let db = northwind.getdatacontext() db.credentials <- system.net.credentialcache.defaultcredentials  // or whatever creds need  // go party 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -