wsdl.exe Error: Unable to import binding '…' from namespace '…'

前端 未结 6 1929
闹比i
闹比i 2020-12-13 19:21

When running wsdl.exe on a WSDL I created, I get this error:

Error: Unable to import binding \'SomeBinding\' from namespace \'SomeNS\'.

  • Unab
6条回答
  •  渐次进展
    2020-12-13 20:03

    In my case the problem was different, and is well described here:

    Whenever the name of a part is "parameters" .Net assumed doc/lit/wrapped is used and generates the proxy accordingly. If even though the word "parameters" is used the wsdl is not doc/lit/wrapped (as in the last example) .Net may give us some error. Which error? You guessed correctly: "These members may not be derived". Now we can understand what the error means: .Net tries to omit the root element as it thinks doc/lit/wrapped is used. However this element cannot be removed since it is not dummy - it should be actively chosen by the user out of a few derived types.

    The fix is as follows, and worked perfectly for me:

    The way to fix it is open the wsdl in a text editor and change the part name from "parameters" to "parameters1". Now .Net will know to generate a doc/lit/bare proxy. This means a new wrapper class will appear as the root parameter in the proxy. While this may be a little more tedious api, this will not have any affect on the wire format and the proxy is fully interoperable.

    (emphasis by me)

提交回复
热议问题