fsprojects / FSharp.Data.WsdlProvider

An implementation of the WsdlProvider compatible with netfx and netcore
Other
24 stars 4 forks source link

NullReferenceException #6

Closed londospark closed 4 years ago

londospark commented 4 years ago

Hi, thank you for the awesome work. Unfortunately I get the following error:

C:\Users\ridec\Code\WsdlProviderTest\Program.fs(4,29): error FS3033: The type provider 'FSharp.Data.WsdlProviderImplementation+WsdlProvider' reported an error: Error while loading wsdl:↔System.NullReferenceException: Object reference not set to an instance of an object.↔   at FSharp.Data.Wsdl.parseWithLoader(XElement wsdl, Uri documentUri, XmlResolver loader, FSharpFunc`2 saveSchema)↔   at FSharp.Data.WsdlProviderImplementation..ctor$cont@644(ConcurrentDictionary`2 cache, String name, String uri, String localSchemaFile, Boolean forceUpdate, Unit unitVar) [C:\Users\ridec\Code\WsdlProviderTest\WsdlProviderTest.fsproj]
C:\Users\ridec\Code\WsdlProviderTest\Program.fs(4,29): error FS3033: The type provider 'FSharp.Data.WsdlProviderImplementation+WsdlProvider' reported an error: Error while loading wsdl:↔System.NullReferenceException: Object reference not set to an instance of an object.↔   at FSharp.Data.Wsdl.parseWithLoader(XElement wsdl, Uri documentUri, XmlResolver loader, FSharpFunc`2 saveSchema)↔   at FSharp.Data.WsdlProviderImplementation..ctor$cont@644(ConcurrentDictionary`2 cache, String name, String uri, String localSchemaFile, Boolean forceUpdate, Unit unitVar) [C:\Users\ridec\Code\WsdlProviderTest\WsdlProviderTest.fsproj]

While trying to run dotnet build on the following code:

open System
open FSharp.Data

type NationalRailProvider = WsdlProvider<"https://lite.realtime.nationalrail.co.uk/OpenLDBWS/wsdl.aspx?ver=2017-10-01">

[<EntryPoint>]
let main argv =
    printfn "Hello World from F#!"
    0

Is there any other information that I can get that might help with this?

thinkbeforecoding commented 4 years ago

Yes, wsdl ans xsd is really hard to get right.. and the XML.Schema thing is full of bill optional values and open inheritance hierarchy 😬

Thank you very much for the sample, it should make it easy to solve 😀

thinkbeforecoding commented 4 years ago

Found two specific things already:

Now checking that the generate service is working.

thinkbeforecoding commented 4 years ago

I don't have values to test... but types are generated.

thinkbeforecoding commented 4 years ago

Oh, and I get an 401 Unauthorized anyway :P I'll publish the new nuget and let you test 😄

thinkbeforecoding commented 4 years ago

Just pushed a v0.5.0 on MyGet that fix the bug 👍