WCF客户端无法使用HTTPS

时间:2016-06-17 13:51:55

标签: web-services wcf

我有一个通过http和https在服务器上运行的web服务,我可以在任何协议上查看来自我的其他机器的WSDL。

但是,在代码中,当我调用它时,我获得了一个用于https调用的404(http很好)。这就是我所做的:

  1. 消费了网络服务
  2. 设置网址
  3. 致电
  4. 还有什么我需要做的吗?我唯一改变的是从http到https的网址。以下是自动生成代码的示例以及我在Reference.cs中的调用:

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.6.1055.0")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="BasicHttpBinding_WebServiceSoap", Namespace="http://www.example.com/WebInterface")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(DLFormBaseType))]
    
     public partial class Scanning : System.Web.Services.Protocols.SoapHttpClientProtocol {
    

    我称之为:

    using (Scanning ws = new Scanning())
    {
        ws.Url = url;
        //web service call
    }
    

    其中url只是Web服务的完全限定网址。

0 个答案:

没有答案
相关问题