Giter Club home page Giter Club logo

fsharp.data.typeproviders's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsharp.data.typeproviders's Issues

WSDLService returning first entry in array response

Description

I'm using the WSDLService type provider to access a webservice. All calls have worked so far with the exception of two call. One of issues is as detailed below. Is there a known workaround?

Repro steps

Given the xml below (part of the wsdl) ,

<xs:complexType name="tQryUserReq">
    <xs:sequence>
        <xs:element name="MSISDN">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="60"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
    </xs:sequence>
</xs:complexType>
<xs:element name="QryUserReq" type="ns:tQryUserReq"/>
<xs:complexType name="tQryUserResp">
    <xs:sequence>
        <xs:element name="PricePlanGoupDtoList" nillable="true" type="ns:tPricePlanGroupDto2"/>
    </xs:sequence>
</xs:complexType>
<xs:element name="QryUserResp" type="ns:tQryUserResp"/>

The signature of the generated function is

QryUser(AuthHeader:tAuthHeader, QryUserReq:tQryUserReq)
  : tPricePlanGroupDto2

Usage

let ret = client.QryUser(getQueryAuthHeader(),req)
    //ret is of type tPricePlanGroupDto2

Expected behavior

An array of data. It actually has two objects.
Was expecting the return type to be tQryUserResp but got tPricePlanGroupDto2

Actual behavior

A response with a single object not the expected array. No error though.

Known workarounds

Related information

  • Operating system : Windows 10
  • Branch: FSharp.Data.TypeProviders v 5.0.0.2 from nuget
  • .NET Runtime, CoreCLR or Mono Version: 4.6.1
  • Performance information, links to performance testing scripts

This is a very old collection of type providers that are Windows-specific and .NET Framework-specific.

Note this is a very old collection of type providers that are Windows-specific and .NET Framework-specific. YOu can't use these type providers with .NET Core or .NET SDK any latest tooling except maybe Visual Studio

For up-to-date type providers see https://fsharp.org/guides/data-access/

For WSDL see https://github.com/fsprojects/FSharp.Data.WsdlProvider for a more recent provider, also https://github.com/fsprojects/SwaggerProvider

Doesn't seem to work with .NET Core

Description

I was following along on the official docs for Query Expressions, until I hit a snag. It seems like this package just doesn't work at all on .NET 5 or .NET Core 3.1. I added the latest version via NuGet. Now I'm getting this message when compiling:

/Users/bbhoss/fse/src/foobar/foobar.fsproj : warning NU1701: Package 'FSharp.Data.TypeProviders 5.0.0.6' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

When I try to compile the example code I get an error:

/Users/bbhoss/fse/src/foobar/TodoItems/TodoItemsModel.fs(11,35): error FS1108: The type 'String' is required here and is unavailable. You must add a reference to assembly 'System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. [/Users/bbhoss/fse/src/foobar/foobar.fsproj]

Is there some way this can be fixed? This is one of the killer apps/fun demos of F#, and it flat out doesn't work.

Will this project be maintained? Update to net5.0?

I would like to see that this project is updated to net5.0. Are there any plans to do this?

Specifically the MSSQL provider part. There is a SQLProvider project, but that also targets other Sql implementations and lacks the specific Sql support. This project does the job excellently, only it has not been updated for more than 2 years.

Compatibility with azure functions

Description

I’ve taken the sample from http://fsprojects.github.io/FSharp.Data.TypeProviders/wsdl.html and tried to get it to work with azure functions via the azure-functions-cli however it’s isn’t compiling:

startup(2,1): warning FS3005: Referenced assembly 'C:\Users\xx\.nuget\packages\FSharp.Data.TypeProviders\5.0.0.2\lib\net40\FSharp.Data.TypeProviders.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found
C:\xxx\run.fsx(9,14): error FS39: The type 'WsdlService' is not defined

Repro steps

run.fsx

open FSharp.Data.TypeProviders

type Wsdl1 = WsdlService<"http://api.microsofttranslator.com/V2/Soap.svc">

let Run(myTimer : TimerInfo, state : string, log : TraceWriter) =
    let ctxt = Wsdl1.GetBasicHttpBinding_LanguageService()
    ignore()

project.json

{
  "frameworks": {
    "net46": {
      "dependencies": {
        "FSharp.Data.TypeProviders": "5.0.0.2"
      }
    }
  }
}

function.json

{
  "disabled": false,
  "bindings": [
    {
      "name": "myTimer",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 * * * * *"
    }
  ]
}
  • Windows
  • FSharp.Data.TypeProviders v5.0.0.2
  • azure-functions-cli v1.0.0-beta.92

Consider removing the reliance on code generators and .NET Fx SDK

This type provider uses the old-fashioned .NET Framework SDK command line tool code generators.

There are a number of problems with this:

  • The .NET SDK (or Windows SDK) must be installed
  • The type provider must find the tools through convoluted registry logic
  • It is not at all cross-platform. Mono has versions of some of these codegen tools but they probably generate slightly different code, and the type provider may bee sensitive to this
  • The code generation being done by these tools is in many cases not very complex, and it may just be simpler to duplicate it
  • The code generation done by the command line tools is out of date compared to that done by the C#-hosted code generators "Add Service Reference" and "Add Database Reference" in Visual Studio, for example doing no generation of Task-based async methods

There are several things that might be done going forward

  • Simply replace the code generation wholesale and just do it all in the type provider itself
  • Add the codegen tool binaries to the "tools" directory of the nuget package, so they are in a strongly known place.

Reference not found or The .NET SDK 4.0 or 4.5 tools could not be found

Description

I did a fresh install of VS2017 on a Windows 7 machine. When I tried to run a script file with the FSharp.Data.TypeProviders.dll the reference was not found, although it exists on the machine in the C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0 folder. When using a local packages install I got an error: The .NET SDK 4.0 or 4.5 tools could not be found

Repro steps

Please provide the steps required to reproduce the problem

  1. Use a Windows 7 machine

  2. Install VS2017 with F# language support

  3. Reference the FSharp.Data.TypeProviders.dll in a script file

Expected behavior

The dll can be referenced and used.

Actual behavior

See above in the description

Known workarounds

Use the local installed FSharp.Data.TypeProviders.dll.
Download and install the SDK for Windows 8.1 (only select the .net SDK).

Related information

  • Windows 7
  • .NET 4.0/4.5

WsdlService not working with VS2017 15.7.0

Description

After upgrading to Visual Studio 15.7.0 the type provider doesn't compile.

Repro steps

I can reproduce it with a minimal example:

  1. Create a file named example.fs with the following lines
open FSharp.Data.TypeProviders

type Wsdl1 = WsdlService<"http://api.microsofttranslator.com/V2/Soap.svc">
  1. compile with the following command line
    "C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0\fsc.exe" --times --nocopyfsharpcore -r:"fsharp.data.typeproviders\5.0.0.3-beta\lib\net40\FSharp.Data.TypeProviders.dll" -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.ServiceModel.dll" example.fs 

fsharp.data.typeproviders is the folder copied from my .nuget

Expected behavior

The code should compile without problems, I just tried it on a Visual Studio version 15.6.7

Actual behavior

The compilation fails with the following error:

error FS0193: Il file 'C:\Users\MyUser\ExampleFolder\tmpBC2F.dll' non è stato trovato.

which is "File not found" in italian. Here is the complete output of the given command line:

Microsoft (R) F# Compiler version 10.1.0 for F# 4.1
Copyright (c) Microsoft Corporation. All Rights Reserved.

warning FS0075: The command-line option 'times' is for test purposes only
TIME:  0.3 Delta:  0.1 Mem:  67 G0:   1 G1:  1 G2:  1 [Import mscorlib and FSharp.Core.dll]
TIME:  0.3 Delta:  0.0 Mem:  70 G0:   0 G1:  0 G2:  0 [Parse inputs]
TIME:  0.3 Delta:  0.0 Mem:  78 G0:   0 G1:  0 G2:  0 [Import non-system references]
TIME:  0.6 Delta:  0.3 Mem:  97 G0:   1 G1:  0 G2:  0 [Typecheck]
TIME:  0.6 Delta:  0.0 Mem:  97 G0:   0 G1:  0 G2:  0 [Typechecked]
TIME:  0.6 Delta:  0.0 Mem:  97 G0:   0 G1:  0 G2:  0 [Write Interface File]
TIME:  0.6 Delta:  0.0 Mem:  97 G0:   0 G1:  0 G2:  0 [Write XML document signatures]
TIME:  0.6 Delta:  0.0 Mem:  97 G0:   0 G1:  0 G2:  0 [Write XML docs]
TIME:  0.6 Delta:  0.0 Mem:  97 G0:   0 G1:  0 G2:  0 [Write HTML docs]
TIME:  0.7 Delta:  0.1 Mem: 102 G0:   0 G1:  0 G2:  0 [Encode Interface Data]
TIME:  0.7 Delta:  0.0 Mem: 102 G0:   0 G1:  0 G2:  0 [Optimizations]
TIME:  0.7 Delta:  0.0 Mem: 102 G0:   0 G1:  0 G2:  0 [Ending Optimizations]
TIME:  0.7 Delta:  0.0 Mem: 102 G0:   0 G1:  0 G2:  0 [Encoding OptData]

example.fs(3,75): warning FS0988: Main module of program is empty: nothing will happen when it is run
TIME:  0.7 Delta:  0.0 Mem: 103 G0:   0 G1:  0 G2:  0 [TAST -> IL]
TIME:  0.7 Delta:  0.0 Mem: 103 G0:   0 G1:  0 G2:  0 [Find assembly references]
TIME:  0.8 Delta:  0.0 Mem: 105 G0:   0 G1:  0 G2:  0 [Static link]
ilwrite: TIME      0.000 (total)        0.781 (delta) - Write Started

error FS0193: Il file 'C:\Users\MyUser\ExampleFolder\tmpBC2F.dll' non è stato trovato.
STATS: #ByteArrayFile = 5, #MemoryMappedFileOpen = 27, #MemoryMappedFileClosed = 0, #RawMemoryFile = 0, #WeakByteArrayFile = 0

The temporary .dll file doesn't exist indeed, it looks like it gets created somewhere else, but some other function looks for it in the source's folder.

I tried with both the current production version on nuget.org, 5.0.0.2 and the beta 5.0.0.3-beta with no luck.
Of course the same issue arises when compiling a complete solution from VS.

Known workarounds

None I am aware of.

Related information

  • Windows 10 Enterprise (10.0.15063)
  • Visual Studio 15.7.0 and related tools
  • .NET Framework 4.6.2 and 4.7

WSDLService - The type 'String' is required here and is unavailable

Description

After I added the following lines.

open FSharp.Data.TypeProviders

type Wsdl1 = WsdlService<"http://api.microsofttranslator.com/V2/Soap.svc">
let ctxt = Wsdl1.GetBasicHttpBinding_LanguageService()

I got this error message:
The type 'String' is required here and is unavailable. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

Repro steps

Using VSCode.

  • In a new project I just added FSharp.Data and FSharp.Data.TypeProviders packages via Paket with an explicit target of netcoreapp2.1
  • Added the lines mentioned above

Expected behavior

Build withot problems.

Actual behavior

Shows error message as I mentioned above.

Known workarounds

None.

Related information

  • Operating system - MacOS 10.13.4
  • .NET Runtime, CoreCLR or Mono Version
NET Core SDK (reflecting any global.json):
 Version:   2.1.502
 Commit:    c74ce8f29f

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.502/

Host (useful for support):
  Version: 2.1.6
  Commit:  3f4f8eebd8

.NET Core SDKs installed:
  2.1.301 [/usr/local/share/dotnet/sdk]
  2.1.502 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Mono

Mono JIT compiler version 5.16.0.221 (2018-06/b63e5378e38 Mon Nov 19 18:08:09 EST 2018)

SqlDataConnection: Cannot build the type provider when exists a table named "dbo.Connection"

Description

When in the database exists the table dbo.Connection the compiler fails to build the type because it already has a property named Connection.
A solution can be to add the "dbo_"' prefix to the property in this special case

Repro steps

Please provide the steps required to reproduce the problem

  1. Create a database named MyDatabase with this table
    CREATE TABLE [dbo].[Connection](
    [Name] nchar NULL
    )

  2. Compile this code
    open FSharp.Data.TypeProviders

type Sql = SqlDataConnection<"Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=True;">

[]
let main _ =
//let db = Sql.GetDataContext()
0 // return an integer exit code

Expected behavior

the SQL type is correctly build

Actual behavior

The build fails with the error FS2014:

A problem occurred writing the binary 'C:\Projects\Prova_F\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe': Error in pass2 for type Program, error: Error in pass2 for type Sql, error: Error in pass2 for type ServiceTypes, error: Error in pass2 for type SimpleDataContextTypes, error: Error in pass2 for type MyDatabase, error: duplicate entry 'Connection' in property table ConsoleApplication1

Known workarounds

Change the schema or the name of the table Connection

Related information

SQL Server 2014
Console Application compiled with vs 2017 and .net framework

Asks for assembly reference in F# 5.0 and .Net 5 when utilizing ODataService.

Using F# 5.0 and .Net 5 on Windows 10 x64 with Visual Studio 2019 16.8.1.

In the following code sample, the script seems to runs OK but I get IntelliSense errors and red wiggly lines in the "let query = ..." expression. It asks for a reference to be added to assembly: System.Data.Services.Client, and in a .Net 5 projects, that's just not doable.

type Northwind = ODataService<"http://services.odata.org/Northwind/Northwind.svc">

let db = Northwind.GetDataContext()

// A query expression.
let query =
    query {
        for customer in db.Customers do
            select customer
    }

WdslProvider Accept both https and http for single type

Description

I have a service that uses https when in production mode, but uses http for dev and beta mode.

This is basically the error:

The provided URI scheme 'https' is invalid; expected 'http'

I can dynamically change the endpoint address. But there doesn't appear to be a way to change the transportMode.

As seen here:
https://github.com/fsharp/fsharp/blob/master/src/fsharp/FSharp.Data.TypeProviders/TypeProviders.fs#L984

Repro steps

Create a WsdlProvider for an http url and then change the endpoint to https later on in the code. You can do the opposite also. Both will give errors.

type ExampleService = WsdlService<"http://example.com/service.svc">
let exampleService () =
        ExampleService.GetBasicHttpBinding_IExampleService (System.ServiceModel.EndpointAddress "https://production.example.com/service.svc"

Expected behavior

The expected behavior is to be able to switch between http and https at runtime. I don't know if it is possible though.

Actual behavior

When switching between https and http the error is given:

The provided URI scheme 'https' is invalid; expected 'http'

Known workarounds

What is done is C# is to use the Web.config file. When compiling use Web.Release.config for production.

Related information

  • Windows 7
  • .NET Runtime

Problem with refresh in SqlDataConnection for Visual Studio 2017

Description

When using the SqlDataConnection in Visual Studio 2017 that points to SQL Server 2017, schema changes are not recognized upon recompilation. This is using .NET

Repro steps

  1. Create a F# class library with .NET Framework 4.7.1 . (Note this is "NOT" using .NET core or .NET Standard)
  2. Add a reference to the Microsoft.FSharp.Data.TypeProvider
  1. Create a SqlDataConnection type provider that uses a string connection and Force Update = true
  2. For an existing table, add a column or remove a column and then recompile the F# project.

Expected behavior

I would expect upon recompilation that I would see the new column in the Service Type or the removed column would no longer be in the service type. This is how it behaves in Visual Studio 2015, but not in Visual Studio 2017

Actual behavior

Actual Behavior, no change is reflected in the Service Type.

Work Around

The workaround I have used is modify the connection string by adding a space.

It seems as something is "cached" with the connection string that will not reflect the database change.

Related information

Operating System: Windows 10
.NET Runtime: 4.7.1
Visual Studio Version: 2017 Version 15.5.6
This is NOT using .NET core or .NET standard.

Followup on https://github.com/dotnet/fsharp/issues/12078

@dsyme I don't know if you meant follow-up like this. If not sorry.

I've tried updating in the test project I described, and it doesn't appear to make any difference, unfortunately.

I'm going to investigate the newer versions, but there's quite a big solution behind this and I'm not sure all of it is going to play nicely with newer .NET versions.

Thanks.

Can WSDL be a standalone package?

The others:

  • EdmxFile, SqlDataConnection, SqlEntity: obsolete by community packages
  • OData: ok, btw i see v2, latest is 4.0.

WSDL

WSDL it's good, it's used (but c# generated servicesclient are easier) because web services it's a technology used in real world (asmx/wcf/java interop).
It can improve a bit, if we find source code of svcutils (i should be somewhere oss i think) and remove dependency of svcutil.exe.

Update to latest TPSDK

Description

(This is a detailed description for an interested member of the FSSF Slack, @gfritz)

In order to be a proper cross-targeting TP this repo needs to be updated to the newest SDK.
There will likely need to be other changes to allow for full xplat support (mentioned in other issues around mono tooling and whatnot), but this step will at least allow the TP to be used successfully with dotnet build on windows machines.

Repro steps

Procedure:
0. run the build script ./build.cmd to build the project in its current state

  1. Add the TPSDK file dependencies to paket.dependencies:
github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fsi
github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypes.fs
github fsprojects/FSharp.TypeProviders.StarterPack src/ProvidedTypesTesting.fs
  1. Add the files to the paket.references in the FSharp.Data.TypeProviders project (ignore ProvidedTypesTesting.fs for now):
File: ProvidedTypes.fsi
File: ProvidedTypes.fs
  1. Remove the old Type Provider SDK files from the FSharp.Data.TypeProviders project. Note that you will need to make sure the files are deleted from the file system AND the project file
src/FSharp.Data.TypeProviders/TypeProviderEmit.fs
src/FSharp.Data.TypeProviders/TypeProviderEmit.fsi
  1. run .paket/paket.exe install to add the appropriate project file entries to the project as specified in the paket.references file.
  2. Make appropriate code changes to TypeProviders.fs to update to the new SDK API surface. This should be a relatively mechanical translation. The majority of the code should remain the same, with a few simple translations:
    • Casing has changed for common constructor parameters: IsErased => isErased, IsStatic => isStatic, etc.
    • Some calls take an Expr list now instead of an Expr [], so you'll need to convert where appropriate with List.ofArray or Array.toList, etc.
  3. Once the project builds again, run the tests by running ./build.sh again. Some failures are to be expected. Once the test are running, you can investigate the results and we can go from there. The tests will likely fail after the transition, because there were some invariants that no longer hold. That's cool, we'll just work through them.

[Feature request] Schema not refreshed upon alteration of connected database.

This is a re-post of an issue from the main VisualFSharp GitHub site upon recommendation from @dsyme. Original here: dotnet/fsharp#1301

Description

If the schema of a database to which there is a connection via type providers SqlDataConnection or SqlEntityConnection is altered, the changes are not accessible within Visual Studio and are not represented by IntelliSense.

However, changing the connection string in some "insignificant" way, such as adding white space, will force the refresh of the schema. Restarting Visual Studio will also refresh the schema.

This is okay when working with an established, production database, but when developing a database and making frequent changes to it, this becomes very annoying.

Repro steps

Connect to a database via an SQL type provider. Add and/or drop tables from database (other changes not tested). Try to refer to the new tables within code.

Expected behavior

That changes to database schema be immediately reflected in IntelliSense and usable in code.

Actual behavior

Old schema still present in IntelliSense, e.g., no newly added tables are accessible, and dropped tables are still listed. Even turning off "Statement Completion" doesn't help. Reference to a new table shows as an error.

There is no background process to detect changes to database structure and update the schema upon which F# is operating.

Known workarounds

Add white space to connection string which doesn't affect the functionality. Example:

"Data Source=(localdb)\ProjectsV13;Initial Catalog=db" can be changed to "Data Source =(localdb)\ProjectsV13; Initial Catalog = db" (spacing placed around equals and semicolon)

Related information

All versions of F# and Visual Studio to-date.

Feature Request

Response from @dsyme: "Presumably that would work by a regular background task polling the database to look for schema changes."

I have no way of knowing if this is feasible, but it would be WONDERFUL if it were fixed. I assume that the issue revolves around the IDE.

WSDL type provider does not work with multiple endpoints

from Visual F# Tools, via fsbugs, and Stack Overflow

The WSDL type provider erroneously generates too many overloads for creating the simplified data context types in the case where the service URI provided hosts multiple endpoints.

The TP ends up generating a number of overloads which differ only in return type, which is not valid. The compiler encounters an internal error when this occurs.

foo

Cause:
TypeProviders.fs line ~1075
The static methods for all endpoints are generated for all context types. This is incorrect - each WSDL endpoint only corresponds to 1 context type. We should be filtering the endpoints here to use only the one which matches the current serviceInterfaceType.

File attachments

Error in FSC: Could not find file '...\tmp8CF2.dll'

Description

Getting file not found error from FSC.exe when attempting to compile an F# console app that uses SqlDataConnection.

Repro steps

  1. Create new F# console app
  2. Add NuGet reference to FSharp.Data.TypeProviders
  3. Add reference to System.Data.Linq
  4. Declare SqlDataConnection type in Program.cs using SqlDataConnection with a valid connection string
  5. let db = connection.GetDataContext()

Expected behavior

Program to compile with no errors.

Actual behavior

Error FS0193 Could not find file 'C:...\tmp8CF2.dll.
The exact tmp file name changes on each attempt to build.

Known workarounds

None

Related information

  • Windows 10
  • .NET Framework 4.6.2

WSDLService fails to deserialize body with multiple data

Description

I'm using the WSDLService type provider to access a webservice. All calls have worked so far with the exception of two call. One of issues is as detailed below. Is there a known workaround?

Repro steps

Can't provide url to actual webservice but the signature of the generated function is

QueryAccBal(AuthHeader: tAuthHeader, QueryAccBalBO: tQueryAcctBalBO, SubsType: byref<string>)
    : tBalDtoListResponse[]

Usage

let ret = client.QueryAcctBal(getAccountAuthHeader(), req)
//ret is of type tBalDtoListResponse [] * string

The response xml that result in this error is

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:QueryAcctBalBOResponse xmlns:ns="http://com.z.zs/xsd">
         <BalDtoList>
            <BalID>1</BalID>
            <AcctResID>1</AcctResID>
            <AcctResName>Local Currency</AcctResName>
            <BalType>1</BalType>
            <Balance>0</Balance>
            <EffDate>2016-09-15 00:00:00</EffDate>
            <ExpDate>2016-12-14 11:45:21</ExpDate>
            <UpdateDate>2016-09-15 11:45:25</UpdateDate>
            <ConsumeBal>0</ConsumeBal>
            <ReserveBal>0</ReserveBal>
            <InitBal>0</InitBal>
            <GrossBal>0</GrossBal>
         </BalDtoList>
         <BalDtoList>
            <BalID>2</BalID>
            <AcctResID>3</AcctResID>
            <AcctResName>Data Volume</AcctResName>
            <BalType>4</BalType>
            <Balance>-10485760</Balance>
            <EffDate>2016-09-27 05:05:46</EffDate>
            <ExpDate>2016-10-27 05:05:46</ExpDate>
            <UpdateDate>2016-09-27 05:05:55</UpdateDate>
            <ConsumeBal>0</ConsumeBal>
            <ReserveBal>0</ReserveBal>
            <InitBal>-10485760</InitBal>
            <GrossBal>-10485760</GrossBal>
         </BalDtoList>
         <SubsType>Prepaid</SubsType>
      </ns:QueryAcctBalBOResponse>
   </soapenv:Body>
</soapenv:Envelope>

Expected behavior

Expected code to work

Actual behavior

An exception was thrown

An unhandled exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll

Additional information: Error in deserializing body of reply message for operation 'QueryAcctBal'.

Known workarounds

Related information

  • Operating system : Windows 10
  • Branch: FSharp.Data.TypeProviders v 5.0.0.2 from nuget
  • .NET Runtime, CoreCLR or Mono Version: 4.6.1
  • Performance information, links to performance testing scripts

How to manually manage transaction/isolation level?

I cannot find a way to manually begin/commit/rollback a transaction or to explicitly set its isolation level.

SubmitUpdates() seems to automatically create its own transaction (if any?).

Is that behavior wanted/expected or am I missing something?

Add namespace as a parameter to SqlDataConnection

From http://fslang.uservoice.com/forums/245727-f-language/suggestions/8951176-add-namespace-as-a-parameter-to-sqldataconnection

"Right now there doesn't appear to be any way to define a namespace to be passed to SqlMetal. This is problematic when you have a database object named System as it conflicts with System imports/usings."

luketopia commented · July 31, 2015 00:56

I have run into this problem as well. I'm not sure being able to control the namespace provides any benefit since the namespace is only used in the code generation process and the generated types are ultimately relocated / nested under the root provided type. I think that the type provider just needs to pass some dummy namespace when calling SqlMetal rather than nothing as it does now.

Cannot build using dotnet build

Description

When I try to build a project using FSharp.Data.TypeProviders, the project builds using VS 2019, but when trying dotnet build, i.e. msbuild command line the build fails.

I have created a repository to reproduce

Repro steps

Please provide the steps required to reproduce the problem

  1. Clone the test project that demonstrates the problem: git clone https://github.com/halcwb/DataPojectBuildProblem.git

  2. Open the solution using VS. There is an error because the connection string is empty.

  3. Try to build the solution using dotnet build

Expected behavior

An error message indicating the empty connection string.

Actual behavior

An error containing:

\DataContext.fs(18,15): error FS1108: The type 'String' is required here and is unavailable. You must add a reference to assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral

Known workarounds

Using VS to build the solution.

Related information

.NET Core SDK (reflecting any global.json):
Version: 3.1.201
Commit: b1768b4ae7

Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.201\

Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8

.NET Core SDKs installed:
2.1.701 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.301 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.101 [C:\Program Files\dotnet\sdk]
3.1.201 [C:\Program Files\dotnet\sdk]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.