Error Consuming a RPC/Encoded SOAP web service in .NET

為{幸葍}努か 提交于 2019-12-03 08:57:59
Graviton

Is it a bug in wsdl.exe? I have a few unpleasant encounters with wsdl.exe. Here are the problems outlined in my post:

The first issue it fails to handle sequence with complex element. You would think that in today's webservice environment, a sequence of complex elements is a norm. But apparently Microsoft doesn't think so, and this results in inability of wsdl.exe to handle a sequence of complex elements.

What if you insist on using wsdl.exe to generate proxy class for element with a sequence of complex types? You will get a cryptic exception: unable to import binding * from namespace * - unable to import operation * - the datatype * is missing The second bug wsdl has is that it is not permissible to have two web methods that have the same return signature. Yes, if one method returns a type of ComplexType, the other methods must have a different return type. Failing to do so will result in an System.InvalidOperationException: The XML element * from namespace * references a references a method and a type exception.

Note that in both cases the messages are cryptic. You won't actually know what's going on behind the hood. And this is the most frustrating of all. You don't know whether you fail because the tool is lousy, or because you are not doing things right.

Maybe you can refer to this post for an alternative of wsdl.exe.

It's worth noting that rpc/encoded SOAP implementation have problems on complex types. One way around this problem is to convert the WSDL to Document/Literal format.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!