fsprojects / FSharp.Data.WsdlProvider

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

Unexpected wrapper element exception #3

Closed marcingolenia closed 4 years ago

marcingolenia commented 4 years ago

Hello! thanks for great work. I cam across one issue. Here's complete test:

module Tests

open Xunit
open FSharp.Data
open System.ServiceModel

type EuVatService = WsdlProvider<"http://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl">

[<Fact>]
let ``Wsdl provider can reach eu soap api and retrieve info that a company is registered company.`` () =
    use client = new EuVatService.checkVatPortClient(BasicHttpBinding(), EndpointAddress("http://ec.europa.eu/taxation_customs/vies/services/checkVatService"))
    let result = client.checkVat(new EuVatService.checkVat("PL", "5241358463"))
    Assert.True(result.valid)

Ther error:

ServiceModel.FaultException: Unexpected wrapper element {urn:ec.europa.eu:taxud:vies:services:checkVat}checkVat found. Expected {urn:ec.europa.eu:taxud:vies:services:checkVat:types}checkVat. at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) in /_/src/System.Private.ServiceModel/src/System/ServiceModel/Channels/ServiceChannel.cs:line 956

thinkbeforecoding commented 4 years ago

I'm working on a better xsd parsing/type generation. It should be ready soon, and I'll try it wit the given wsdl 👍

thinkbeforecoding commented 4 years ago

Fixed by #4

thinkbeforecoding commented 4 years ago

There is still work to do to generate enums correctly, but they can be passed as string for now.

thinkbeforecoding commented 4 years ago

@marcingolenia don't hesitate to open new issues as you find them. It'll help make the result better.

Since it's a rewrite from scratch compared to the historic TP, a lot of previously working scenarios can be missing for now.