我转到https://mywebsite/MyApp/Myservice.svc并收到以下错误:
(如果我使用http://链接有效)
" 由于编译期间的异常,无法激活服务'/MyApp/MyService.svc'.例外消息是:找不到与绑定BasicHttpBinding的端点的方案https匹配的基址.注册的基址方案是[http ] .. "
编辑:所以如果我address=""改为address="https:// ..."那么我得到这个错误:
" 错误:不支持协议'https'..... '带有合同的' https://.../Annotation.svc ' 的ChannelDispatcher '"Annotation"'无法打开其IChannelListener. "
这是我的Web.Config样子:
<services>
      <service behaviorConfiguration="AnnotationWCF.AnnotationBehavior"
              name="AnnotationWCF.Annotation">
              <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Annotation"
                      contract="AnnotationWCF.Annotation" />
              <endpoint address="" 
                  binding="basicHttpBinding" bindingConfiguration="SecureTransport"
                  contract="AnnotationWCF.Annotation" />
              <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
<bindings>
<basicHttpBinding>
    <binding name="BasicHttpBinding_Annotation" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647"
            maxNameTableCharCount="2147483647" />
    </binding>
    <binding name="SecureTransport" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647">
        <security mode="Transport">
        <transport clientCredentialType="None"/>
        </security>
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647"
            maxNameTableCharCount="2147483647" />
    </binding> …尝试在Silverlight应用程序中对HTTPS端点进行Web服务调用会导致此错误:"无法找到与绑定WSHttpBinding的端点的方案https匹配的基址.已注册的基址方案为[http]"
与此处发布的问题相同:
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4c19271a-f5e6-4659-9e06-b556dbdcaf82/
因此,其中一个建议是:"另一个问题可能是证书名称和机器名称不一致,这导致WCF适合.如果是这种情况,您可以告诉WCF跳过验证证书."
好吧,我确实收到了证书错误,因为这只是一个演示服务器.
以下是我设置客户端的方法:
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
_ws = new AnnotationService.AnnotationClient(binding, new EndpointAddress(myAddress));
如何告诉WCF跳过验证?
public class MyWebControl {
    [ExternallyVisible]
    public string StyleString {get;set;}
}
public class SmarterWebControl : MyWebControl {
    [ExternallyVisible]
    public string CssName{get;set;}
    new public string StyleString {get;set;} //Doesn't work
}
是否可以删除子类中的属性?我确实希望该属性被其他子类继承,而不是这个.
编辑:哎呀,看起来我忘了编译或者其他东西,因为上面发布的代码确实有用!
我有一个C#Web应用程序需要将文件部署到客户端计算机的硬盘驱动器.(Adobe Acrobat的javascript文件)
如果客户端使用的是mac,我会有一个AppleScript,它会在应用程序目录中搜索acrobat,然后将JS文件部署到正确的位置.
问题是我目前正在mac上创建applescript,然后将其移动到服务器.applescript至少有一条消息(说它已成功完成),此消息需要以用户选择的语言显示(在Web应用程序中指定)
那么,有没有办法在我的Windows C#服务器上创建applescript(使用嵌入的语言字符串),然后将其发送到客户端?
c# ×2
https ×2
wcf ×2
applescript ×1
attributes ×1
certificate ×1
http ×1
installer ×1
silverlight ×1