【发布时间】:2018-11-21 03:38:17
【问题描述】:
我正在尝试从用 Java (JAX-WS) 制作的 Web 服务导入 WSDL 定义,以便在我的 net core 2.1 应用程序中使用它。按照执行此操作的步骤,我使用了 Connected Services 和 Microsoft WCF Web 服务参考提供程序。放置服务的uri,列出可用的服务,更改默认命名空间并完成其他步骤而没有任何错误。最后,该工具为 Web 服务创建了一个代理引用,但没有模型。
下面是请求类的代码sn-p和生成的接口。
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.1")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="SERVICO_ENTRADA", WrapperNamespace="http://caixa.gov.br/sibar/manutencao_cobranca_bancaria/boleto/externo", IsWrapped=true)]
public partial class INCLUI_BOLETORequest
{
public INCLUI_BOLETORequest()
{
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("dotnet-svcutil", "1.0.0.1")]
[System.ServiceModel.ServiceContractAttribute(Namespace="http://caixa.gov.br/sibar/manutencao_cobranca_bancaria/boleto/externo", ConfigurationName="GerencialISP.ServicosExternos.CobCaixa.manutencao_cobranca_bancaria")]
public interface manutencao_cobranca_bancaria
{
[System.ServiceModel.OperationContractAttribute(Action="IncluiBoleto", ReplyAction="*")]
System.Threading.Tasks.Task<GerencialISP.ServicosExternos.CobCaixa.INCLUI_BOLETOResponse> INCLUI_BOLETOAsync(GerencialISP.ServicosExternos.CobCaixa.INCLUI_BOLETORequest request);
...
}
这是 WSDL 链接:http://barramento.caixa.gov.br/sibar/ManutencaoCobrancaBancaria/Boleto/Externo?wsdl
如您所见,导入架构中的所有模型在生成的代码中均不可用。也尝试了 svcutil 工具,但没有成功。
做错了什么?是否存在生成有效代理的方法,或者我需要使用 Web 请求手动生成?
【问题讨论】:
标签: c# .net web-services .net-core wsdl