WCF:Svcutil生成无效的客户端代理,Apache AXIS Web服务,重载操作

Mar*_*ood 5 wcf wsdl svcutil.exe

我正在使用用Java编写并使用Apache Axis 1.3的第三方Web服务。该服务有许多重载操作。当WCF Svcutil生成代理时,它通过在操作名称后面附加一个数字来重命名重载的操作。例如:

getDataResponse getData(getDataRequest request);

getDataResponse1 getData1(getDataRequest1 request);
Run Code Online (Sandbox Code Playgroud)

这本身不是问题,但是当Svcutil生成请求/响应消息时,它忽略了更改MessageContracts的WrapperName属性。

    [MessageContractAttribute(
        WrapperName = "getData", 
        WrapperNamespace = "http://namespace.com", 
        IsWrapped = true)]
    public partial class getDataRequest1 {  ..  }
Run Code Online (Sandbox Code Playgroud)

当客户端应用程序尝试打开代理时,将引发以下异常:

InvalidOperationException:操作getData1中的RPC消息getDataRequest1具有无效的主体名称getData。它必须是getData1

如果我更改WrapperName =“ getData1”,则代理将打开,但是...

  1. 我无法调用该操作,因为该服务无法识别“ getData1”
  2. 该服务有近1100次操作,其中近一半是超载

有什么方法可以生成和/或修改代理,以便所有操作都可以与WCF一起使用?

标记

Mit*_*tch 5

For what it is worth (4 years later), it seems that by calling WSDL.exe manually and passing the /protocol:SOAP parameter, this problem can be avoided. Generating a service client through the UI still seems to cause this issue as of VS2012 for services generated by Apache Axis.

Example usage:

c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools>wsdl /l:cs /protocol:SOAP http://rxnav.nlm.nih.gov/RxNormDBService.xml /out:c:\drop\rxnavapi.cs
Run Code Online (Sandbox Code Playgroud)

编辑: sphinxxx正确地指出,SOAP协议选项在UI中作为“ 添加Web引用 ” 公开,因此wsdl.exe不需要直接执行。


Mar*_*ood 3

我能够找到的唯一解决方法是手动编辑生成的代码并删除所有不需要的重载。